How to change the font of the template?

Follow below steps to use a different .ttl font in WooCommerce PDF Invoices Premium:

  1. Add attached fonts to wp-content/uploads/woocommerce-pdf-invoices/fonts folder. Make sure to rename the file to below formats.

R = Regular (OpenSans-R.ttf)
B = Bold (OpenSans-B.ttf)
I = Italic (OpenSans-I.ttf)

  1. Create a custom template and name it something like minimal-opensans. Within file style.css change the font within font-family to your fonts name. Use lowercase like opensans.
  2. Add the template to wp-content/uploads/woocommerce-pdf-invoices/templates/invoice/simple folder.
  3. Select new added template within Template settings tab. Save settings. Done!

Note: Add below filters to your themes functions.php when using RTL!

function bewpi_fontdata( $fontdata ) {
   $fontdata['iransans']['useOTL'] = 0xFF;
   $fontdata['iransans']['useKashida'] = 75;

   return $fontdata;
}
add_filter( 'bewpi_fontdata', 'bewpi_fontdata' );

function bewpi_mpdf( $mpdf, $document ) {
   // change the direction of the invoice to RTL.
   $mpdf->useSubstitutions = false;
   $mpdf->SetDirectionality( 'rtl' );

   return $mpdf;
}
add_filter( 'bewpi_mpdf', 'bewpi_mpdf', 10, 2 );

Still need help? Contact Us Contact Us