-
-
Notifications
You must be signed in to change notification settings - Fork 97
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
TTC and OTC font files cause Rusttype(IllFormed) #28
Comments
Yes, rusttype doesn't support TTC and OTF files, only TTF (and OTF fonts that are a direct wrapper of a TTF font). The question is whether I'd want to go back to using freetype because it caused compliation problems on Windows. |
Perhaps it would work to use https://github.com/pcwalton/font-kit? |
No, font-kit is for finding fonts on the computer, not decoding them (it uses freetype for that). It's a completely different tool, it has nothing to do with decoding fonts. |
font-kit let's you get the metrics for fonts using the system font libraries. i.e. CoreText on Mac and DirectWrite on Windows. By default it will only use FreeType on Linux. Is there information that printpdf needs to get from the fonts that font-kit doesn't provide? |
I wonder if we could replace rusttype with the allsorts crate. |
It seems Unreleased
|
|
So this issue should be resolved by just updating rusttype to 0.9, shouldn't it? It's good to hear that rusttype now supports OTF, but at some point I have to refactor it with something like a |
Any updates on this? I'll take a stab at it myself. It's holding up the hack to get around #2, too. |
I tried updating to rusttype 0.9, but ran into some refactoring errors. You just need to update the crate and fix the resulting compilation errors. |
I think I've got it mostly sorted, just have to fix a few glyph size issues. Seems the rusttype guys ditched some key 0.8 apis that don't have direct equivalents. It now handles |
I'm a little stumped right now. For Zilla Slab Highlight Bold, the PDF contains "O" ( My changes are at eitasuka/printpdf and the above broken pdf in this gist. |
@eitasuka It's likely because the See: 209bb91 - you have to use the correct |
Switched to |
Reading opentype fonts(.otf) or truetype collection files (.ttc) causes panic!
The second line caused panic, and retrun Rusttype(IllFormed).
I tried .ttc file and this also failed.
The text was updated successfully, but these errors were encountered: