-
Notifications
You must be signed in to change notification settings - Fork 225
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
Error subsetting CFF font with no Subrs #42
Comments
I believe I ran into this when attempting to render a PDF with Futura PT using pdfmake. Is there any known workaround? I guess I could convert to TTF, but I'm unsure if the font license allows that.
|
I tried adding a simple |
another option is to change the function signature to have a default argument that causes the for loop to immediately exit:
This introduces less code, but also avoids an early return and early returns are great for ensuring code is fast (in that vein, an early return |
If that solution doesn't introduce problems, I can send a pull request for it. After looking at the code I think it won't break things, since the requested subset does not necessarily need to use any subrs anyway (I think?), but I certainly can't claim to understand the actual mechanics of subsetting a CFF font in any detail. Getting this fixed would be nice for me. |
The original issue which I opened against the old coffee script source no longer exists, as there is now a check for Subrs in However, the corresponding line in The advantage of adding the missing null check vs. the proposed fix above is that it won't unnecessarily create an empty Subrs dictionary in the subset font. No Subrs dictionary is needed at all. |
Attempting to subset a CFF font which does not contain a Subrs entry in its Private dictionary results in an exception in subsetSubrs. The problem code is here.
The text was updated successfully, but these errors were encountered: