-
Notifications
You must be signed in to change notification settings - Fork 253
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
Fix crashing google fonts or other TTF font files #121
Conversation
this fixed the bug |
Please merge this commit. |
If using Laravel here is how I'm adding this fix as a patch until this is merged. FYI, I'm using Step 1: Create a Patches Directory
Step 2: Create the Patch File
Step 3: Create the Patching Script
Step 4: Update
Step 5: Apply the Patch
This will apply the patch every time you run |
Nice comment for laravel users. You can also patch this with Add this to your composer.json:
|
Hello wpmvangroesen
|
@hanifbd7 can you give some more details about the code? For ex what fonts are you using, what does your dompdf code look like, etc. If we can reproduce it i can look into it! |
#128 addresses underlying causes of the unpack errors (at least, for those that have been identified). I'm not inclined to include this change since it just masks a parsing error in php-font-lib. |
Of course! Thanks for looking into this and fixing it. |
Current expectation is "as soon as possible" ... I'm trying to finish up the issues slated for the release. Only a few more issues left to investigate, and then some prep work for the release. |
We encountered a lot of issues with
unpack
errors in BinaryStream (see: #47 ) for some of the fonts hosted by Google.The real fix would probably be to better understand the differences in the table definitions. We tried to check this using ttfdump or manually checking the font files, but we didn't find any big issues there. The codebase is pretty old and difficult to debug. So i don't know if anyone would be interested to investigate or fix this in a better way.
This commit solves the problem for us. The library is not crashing and fonts are being rendered in DOMPDF.