WooCommerce PDF Invoices & Packing Slips Using custom fonts

WooCommerce PDF Invoices & Packing Slips  Using custom fonts

copy
wp-content/plugins/woocommerce-pdf-invoices-packing-slips/templates/Simple
to
wp-content/themes/theme_name/woocommerce/pdf/template_name
* 如 theme_name 後沒 woocommerce/pdf/template_name 就自開新 folder…
* e.g : wp-content/themes/pets-grooming/woocommerce/pdf/ev

再在 ev 內新增 fonts
把中文字型 copy 到 fonts/chinese.ttf
* 一定要 ttf 檔

edit ev/style.css
我以 NotoSansCJKtc-Regular.ttf 為例子, add

@font-face {
font-family: ‘MyFont’;
src: local(‘MyFont’), local(‘MyFont’), url(<?php echo $this->get_template_path(); ?>/fonts/NotoSansCJKtc-Regular.ttf) format(‘truetype’);
}

body {
font-family: MyFont;
}

再在 wp-admin WooCommerce PDF Invoices 內
General > Choose a template > ev
Status > Reinstall btn

再 check invoice 應該顯示到中文字啦~~~

Replies: 0 / Share:

You might also like …

Post Comment

Your email address will not be published. Required fields are marked *