-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathwoocommerce-pdf-ips-thai.php
48 lines (45 loc) · 1.52 KB
/
woocommerce-pdf-ips-thai.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
<?php
/**
* Plugin Name: PDF Invoices & Packing Slips for WooCommerce - Thai Language Pack
* Plugin URI: http://www.wpovernight.com
* Description: Adds Thai font (Norasi) to PDF Invoices & Packing Slips for WooCommerce
* Version: 1.0.1
* Author: WP Overnight
* Author URI: http://www.wpovernight.com
* License: GPLv2 or later
* License URI: http://www.opensource.org/licenses/gpl-license.php
*/
function wpo_wcpdf_thai( $document_type, $document ) {
?>
/* Load font */
@font-face {
font-family: 'Norasi';
font-style: normal;
font-weight: normal;
src: local('Norasi'), local('Norasi'), url(<?php echo dirname( __FILE__ ); ?>/fonts/Norasi.ttf) format('truetype');
}
@font-face {
font-family: 'Norasi';
font-style: normal;
font-weight: bold;
src: local('Norasi Bold'), local('Norasi-Bold'), url(<?php echo dirname( __FILE__ ); ?>/fonts/Norasi-Bold.ttf) format('truetype');
}
@font-face {
font-family: 'Norasi';
font-style: italic;
font-weight: normal;
src: local('Norasi Italic'), local('Norasi-Italic'), url(<?php echo dirname( __FILE__ ); ?>/fonts/Norasi-Oblique.ttf) format('truetype');
}
@font-face {
font-family: 'Norasi';
font-style: italic;
font-weight: bold;
src: local('Norasi Bold Italic'), local('Norasi-BoldItalic'), url(<?php echo dirname( __FILE__ ); ?>/fonts/Norasi-BoldOblique.ttf) format('truetype');
}
/* Override font */
body {
font-family: 'Norasi' !important;
}
<?php
}
add_action( 'wpo_wcpdf_custom_styles', 'wpo_wcpdf_thai', 10, 2 );