tecnickcom / TCPDF

Official clone of PHP library to generate PDF documents and barcodes
https://tcpdf.org
Other
4.21k stars 1.52k forks source link

How to add new custom font in tcpdf? #672

Open kamleshwebtech opened 10 months ago

kamleshwebtech commented 10 months ago

1) Search and download required font's ttf file 2) Open http://www.fpdf.org/makefont website in the browser and upload the ttf font on this website 3) Download two files 'customfontname.php' and 'customfontname.z' 4) Copy these two files into '/yourproject/vendor/tecnickcom/tcpdf/fonts/' folder 5) include / set the font in your script before tcpdf html code '$pdf->SetFont('customfontname', '', 12);'

littlepackage commented 10 months ago

Hey @kamleshwebtech

It seems like you should use tcpdf/tools/tcdpf_addfont.php to generate your font files and not fpdf/makefont/makefont.php. After you've set that up, and if you are still having troubles, have you tried other fonts beside the one you desire? It sounds like you're mostly doing it right, but haven't quite asked a specific question here or provided much information for others to be able to reproduce any issue.