-
Notifications
You must be signed in to change notification settings - Fork 45
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Unable to import custom fonts #37
Comments
What symfony2 version do you use? |
i'm using 2.2.1. Thanks for your help |
%resources% pattern is replaced by path to Resources directory in PHPPdf library, so it works ok. In fonts.xml file you should user relative path, for example: "%resources%/../../../../../../app/Resources/PHPPdf/Resources/fonts/somefont.ttf". This solution is not elegant, but it should work. |
I know this is an issue from 2 years ago ...sry I got the same problem and it was not a problem if the specified path. The problem in my case seems to be that the Zend-Framework component loading/opening the fonts does not support all fonts CorruptedFontException: Unable to read version 4 table - so i guess it's a limitation due to the class used which fonts can be included as "custom" font right ? EDIT: |
I was trying to import a custom font (Calibri) in this directory
app/Resources/PHPPdf/Resources/fonts/Calibri
so I create a custom fonts.xml in
app/Resources/PHPPdf/Resources/config/
and change my config.yml inserting these two optional lines, as explained in the guide
ps_pdf:
fonts_file: "%kernel.root_dir%/Resources/PHPPdf/Resources/config/fonts.xml"
but it isn't seen at all because when it load my just modified detail.pdf.twig an error occur
Font "/Applications/XAMPP/xamppfiles/htdocs/myProject/vendor/psliwa/php-pdf/lib/PHPPdf/Resources/fonts/Calibri/bold.ttf" not found.
It's still trying to find the font in the old directory. How can I solve this?
The text was updated successfully, but these errors were encountered: