• Resolved layeghy

    (@layeghy)


    Dear Jake Jackson
    I am using your great pluging (Gravity PDF), just I have an issue with standard font for Persian language. so please help me!
    I have check several ttf Persian Standard font, but in all them, when you open PDF, word characters are separated not joined together :
    For example : Hello in Persian write this way : ????
    but with Standard Persian Custom fonts in Gravity PDF : it will shown : ? ? ? ?

    and finally my questions :
    1- is there any other standard Persian fonts (not Arabic) that I can download it to use in GP !!
    2- if I want convert a ttf font to usable format in Gravity PDF, what can I do or where I can start?

    Thank in advance

    • This topic was modified 4 years, 6 months ago by layeghy.
    • This topic was modified 4 years, 6 months ago by layeghy.
Viewing 4 replies - 1 through 4 (of 4 total)
  • Plugin Author Jake Jackson

    (@blue-liquid-designs)

    Hi there,

    Currently, Gravity PDF makes no guess work when registering custom fonts with Mpdf (the software used to generate PDFs). What that means is, since not all fonts support Open Type layout tables (what’s used to join the cursive Arabic font) 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.

    • This reply was modified 4 years, 6 months ago by Jake Jackson.
    Thread Starter layeghy

    (@layeghy)

    really thanks for your quick reply
    I have solved my problem with another way!!
    it is maybe useful for other person who look for solution..

    I used Iransan.ttf (regular-bold-italic-bold/italic) font and then upload it to font directory in PDF_EXTENDED_TEMPLATES and then rename them to XB Riyaz (regular – bold- italic-bold/italic).

    it solved my problem

    but thank you anyway

    • This reply was modified 4 years, 5 months ago by layeghy.
    mohammedkadhim

    (@mohammedkadhim)

    @layeghy
    Thank you so much. Had similar issue and used your solution which worked like a charm.

    Kind regards,
    Mohammed

    Plugin Author Jake Jackson

    (@blue-liquid-designs)

    Great to hear that, Mohammed! FYI, Gravity PDF 6.0 (currently in beta) has a full overhaul of our Custom Fonts system and any fonts that support it will automatically enable OTL mode.

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘Custome Font for Persian (RTL)’ is closed to new replies.