-
Notifications
You must be signed in to change notification settings - Fork 463
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
Fonts sometimes have an incorrect cmap subtable #1252
Comments
The issue here appears to be that the cmap subtable (format 4) has an odd length count? |
oh interestingg, we do roll out own cmap font thing for optimized subsetting. very possible to have missed something. will test with the "Allsorts" that @mikeday mentioned in his other issue.
@eiswind what's a tool we can test on to confirm we have the right fix? |
I think it might be this line 611 of length := 16 + (8 * segCount) + (numSymbols + 1) The Since this subtable is entirely comprised of 16-bit values it is impossible for it to be odd; the |
It appears that the original PHP fpdf does not have this bug, it just takes the length of the subtable in bytes directly: $data .= pack('nnn', 4, 6+strlen($cmap), 0); // format, length, language |
@alixander please try prince xml https://www.princexml.com/ |
Are there chances that this will get fixed? Sadly I don't get what going on there, so I can't provide a patch. |
@berniexie can you look into this on Tuesday please? |
@eiswind can you give me the exact d2 code of the failed Spring Boot example |
can you not reproduce with some simple "asdf" text? @berniexie |
@alixander not with the latest version of d2. I suspect the issue may already fixed but I wanted to confirm with the exact case that can generate an invalid subset. |
how would it have been fixed? i don't think there's any PR that touched this part since the issue was created |
Nevermind. I was able to reproduce the issue with an example. |
I found that when fonts are embedded, they are not always embedded the same way.
Sometimes the font is correct, sometimes it has an incorrect cmap subtable.
Browsers seem to ignore that but other tools I use to render the svg cannot handle that.
I'll attach two files, one (injection) has the font correctly, the other (boot) one is broken.
The text was updated successfully, but these errors were encountered: