Search code examples
phpfontsembeddingtcpdf

How to use Arial in PDF using TCPDF without embedding


I have successfully added the font Arial to TCPDF, however the filesize is large due to it embedding the font. I would have thought Arial was a standard font on the vast majority of users machines, so is there a way of it working by using Arial if available, then Helvetica if not, then any sans-serif font as a backup?


Solution

  • I found that if I remove all arial files in the fonts folder other than the ones ending in .php, the filesize drops to around 500KB, just like the other core fonts in tcpdf. I would imagine that this means they are now not embedded and will revert to another sans-serif font on the users machine if they don't have arial.