• Hi, recently i noticed that after upgrading to 4.4.0, all my configured pdf contains Bengali fonts, has been broken. The complex font formation has been displaced. it was very good to use on version 4.0.6
    Today, I had to downgraded this plugins to 4.0.6, because, with same configuration, same font file, same entry data & same pictures, Bengali Unicode ttf fonts shows 100% perfect.

    I think the developer has missed something or added something that conflicts or does not supports Bengali fonts.
    [The best Bengali font I have found is: kalpurush.ttf, I request, the developer please test above mentioned version with this font, collect some Bengali text from google or Wikipedia, create an entry and see the difference. V4.4.0 output’s the wrong.]

Viewing 1 replies (of 1 total)
  • Plugin Author Jake Jackson

    (@blue-liquid-designs)

    It’s hard to tell without sample PDFs, but I have a feeling your PDFs on version 4.0.6 aren’t using the custom font you’ve selected and are instead falling back to one of the default fonts shipped with the plugin.

    This custom font vs fall-back font issue was corrected in version 4.3, and your custom fonts would likely have been getting used when you upgraded to 4.4. However, Gravity PDF makes no guess work when registering custom fonts about Open Type layout tables. What that means is, since not all fonts support Open Type layout tables (what’s used to join some fonts like Arabic or Bengali) we don’t enable this functionality at all.

    If you’d like to enable this yourself you can use the “mpdf_font_data” WordPress filter at priority 15 to modify the $fonts array and include the appropriate ‘useOTL’ and ‘useKashida’ options for your custom font. That might look like this:

    add_filter( 'mpdf_font_data', function( $fonts ) {
    	if ( isset( $fonts['notosans'] ) ) {
    		$fonts['notosans']['useOTL']     = 0xFF;
    		$fonts['notosans']['useKashida'] = 50;
    	}
    
    	return $fonts;
    }, 15 );

    You’ll need to adjust ‘notosans’ to the font key assigned to your font, and adjust ‘useOTL’ and ‘useKashida’ as appropriate to your font family. The font key is usually your font name is all lower case without spaces, but may be different. You can modify the function to include print_r($fonts); exit; before the return line and then view the PDF to see the array structure of $fonts to confirm the key.

    Of course, the simplest option would be to work out what fallback font is being used in 4.0.4 and then set that as the default font for your PDF. If you’d like help working that out please submit a support request via our website and include samples of your PDF.

Viewing 1 replies (of 1 total)
  • The topic ‘Bengali font embed problem’ is closed to new replies.