• Hello,
    I have a gift card plugin and I need to install manually the Greek fonts which is not supported by default. So far I created with “makefont” function two versions of my font with .ttf and .z extensions.
    I manually upload them to the appropriate directory. Now, to anyone who may know, I need to to call the “addfont” and “setfont” functions.
    This is what I do but no matter what, the default font “Arial” stays the same.
    I have no experience on this. Perhaps there is something wrong with how I add the code. The fonts are called “AkaAcidDosisRegular” and I must add the following lines:

    $pdf->AddFont(‘customfamily’,”,’customfont’);
    $pdf->SetFont(‘customfont’,’x’,16); 

    Can you help me? Where I must enter those two lines? In the beginning or at the end of the document? It is a find and replace action?
    I know it is a tough question but the answer is crucial to me, since it is the only plugin for non – woocommerce stores, that does this job.
    The whole code can be found here in .doc format

Viewing 3 replies - 1 through 3 (of 3 total)
  • Moderator bcworkz

    (@bcworkz)

    Call AddFont() and SetFont() methods as soon as a new FPDF object is created. See the tutorial at the FPDF site:
    https://www.fpdf.org/en/tutorial/tuto7.htm

    If you still have difficulty, the FPDF forum is probably a better place to seek assistance:
    https://www.fpdf.org/phorum/

    Thread Starter filoumenos

    (@filoumenos)

    Hi @bcworkz
    If I sent you the html code and the names of the fonts, that I have already uploaded in the fpdf directory, will you be able to help me?
    I don’t know to what part of the html I must add the addfont & setfont actions.
    I have already tried your suggestions; I followed the above guides but they didn’t work. Can you make the extra step to help me?
    Thank you,
    Eddie

    Moderator bcworkz

    (@bcworkz)

    The HTML is not where PDF fonts get added. They are added in the PHP code that is generating the PDF file. After you add and set a font, subsequent text content defined by using the Cell() class method will be rendered in that font.

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘Fpdf and Greek Characters’ is closed to new replies.