Topic: Use custom fonts

Hello,

I want to ask how to add new font to the report?

I want to display arabic character and I have downloaded necessary file from TCPDF github: aealarabiya.php, aealarabiya.ctg.z, and aealarabiya.z. I put it in the reporting/fonts folder.

I add:

$rep->AddFont('aealarabiya');
$rep->SetFont('aealarabiya');

Still the output PDF doesn't output any character. Just broken symbol.

Re: Use custom fonts

See this post and this wiki page.

Re: Use custom fonts

Still doesn't work. I think it is loaded but it displays some weird characters. I also have installed the font in my PC but still doesn't work.

Re: Use custom fonts

Refer this page in the wiki for Arabic Fonts in FA and this post. The line number is 157 in FA 2.4 in reporting/includes/class.pdf.inc needs to be edited to reference your font.

Re: Use custom fonts

I've succeded. It seems it is the problem with my linux. After I use locale-gen ar_EG.utf8, I don't even need the alarabiya font. I didn't change the font and it is set to helvetica and it works.