-
Notifications
You must be signed in to change notification settings - Fork 0
/
woocommerce-pdf-ips-unicode.php
53 lines (49 loc) · 1.84 KB
/
woocommerce-pdf-ips-unicode.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
49
50
51
52
53
<?php
/**
* Plugin Name: PDF Invoices & Packing Slips for WooCommerce - Unicode Language Pack
* Plugin URI: http://www.wpovernight.com
* Description: Adds the Arial Unicode MS font to PDF Invoices & Packing Slips for WooCommerce for extended character support
* 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_arial_unicode( $document_type, $document ) {
?>
/* Load font */
@font-face {
font-family: 'Arial Unicode MS';
font-style: normal;
font-weight: normal;
src: local('Arial Unicode MS'), local('Arial Unicode MS'), url('<?php echo dirname(__FILE__); ?>/fonts/Arial Unicode.ttf') format('truetype');
}
@font-face {
font-family: 'Arial Unicode MS';
font-style: normal;
font-weight: bold;
src: local('Arial Unicode MS Bold'), local('Arial Unicode MS-Bold'), url('<?php echo dirname(__FILE__); ?>/fonts/Arial Unicode.ttf') format('truetype');
}
@font-face {
font-family: 'Arial Unicode MS';
font-style: italic;
font-weight: normal;
src: local('Arial Unicode MS Italic'), local('Arial Unicode MS-Italic'), url('<?php echo dirname(__FILE__); ?>/fonts/Arial Unicode.ttf') format('truetype');
}
@font-face {
font-family: 'Arial Unicode MS';
font-style: italic;
font-weight: bold;
src: local('Arial Unicode MS Bold Italic'), local('Arial Unicode MS-BoldItalic'), url('<?php echo dirname(__FILE__); ?>/fonts/Arial Unicode.ttf') format('truetype');
}
/* Override font */
body {
font-family: 'Arial Unicode MS' !important;
}
<?php
}
add_action( 'wpo_wcpdf_custom_styles', 'wpo_wcpdf_arial_unicode', 10, 2 );
add_filter( 'wpo_wcpdf_dompdf_options', function( $options ) {
$options['isFontSubsettingEnabled'] = true;
return $options;
}, 20, 1 );