-
Notifications
You must be signed in to change notification settings - Fork 10k
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
Support CMap-data with only strings, when parsing TrueType composite fonts (bug 920426) #14057
Conversation
/botio-linux preview |
/botio browsertest |
/botio-linux browsertest |
/botio-linux preview |
89b1989
to
3b8eb5a
Compare
From: Bot.io (Linux m4)ReceivedCommand cmd_test from @Snuffleupagus received. Current queue size: 0 Live output at: http://54.241.84.105:8877/147e2a2504a6d73/output.txt |
From: Bot.io (Windows)ReceivedCommand cmd_test from @Snuffleupagus received. Current queue size: 0 Live output at: http://54.193.163.58:8877/4e40753777b5030/output.txt |
From: Bot.io (Linux m4)FailedFull output at http://54.241.84.105:8877/147e2a2504a6d73/output.txt Total script time: 22.54 mins
Image differences available at: http://54.241.84.105:8877/147e2a2504a6d73/reftest-analyzer.html#web=eq.log |
From: Bot.io (Windows)FailedFull output at http://54.193.163.58:8877/4e40753777b5030/output.txt Total script time: 40.62 mins
Image differences available at: http://54.193.163.58:8877/4e40753777b5030/reftest-analyzer.html#web=eq.log |
I think this may be a bug in the cmap parser. Looking at the spec on beginbfchar, it says the second value can be either a "code or name". |
Nevermind about checking the |
For the Also, looking at this code, how would you even get the |
Yeah, forgot about how the ToUnicode cMaps work. For regular font ones the charcode should always fit into a 32bit int. What about always returning a string, that conversion should be pretty fast. Or alternatively differrent forEach methods for strings and ints? |
…fonts (bug 920426) In the referenced bug, the embedded fonts contain custom CMap-data that only include strings. Note how for embedded composite TrueType fonts we're using the CMap-data when building the glyph mapping, and currently we end up with a completely empty map because the code expects only CID *numbers*. Furthermore, just fixing the glyph mapping alone isn't sufficient to fully address the bug, since we also need to consider this "special" kind of CMap-data when looking up glyph widths.
5a1fc4f
to
758be72
Compare
Edit: Actually, this might end up being less code overall. I'll try implementing that as well, probably tomorrow, and see how it looks.
I've tried to implement this, which required some changes to the Edit2: Having, very quickly and without running tests, also tried the "always return strings"-approach I not particularly fond of either way actually. No matter the approach, the code ends up feeling really hacky and I worry about breaking some weird edge-cases with these kind of changes. |
758be72
to
d3ca28b
Compare
/botio test |
From: Bot.io (Linux m4)ReceivedCommand cmd_test from @brendandahl received. Current queue size: 0 Live output at: http://54.241.84.105:8877/c83825082c92734/output.txt |
From: Bot.io (Windows)ReceivedCommand cmd_test from @brendandahl received. Current queue size: 0 Live output at: http://54.193.163.58:8877/bf70a22fa6671f6/output.txt |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sounds good. r+ with passing tests
From: Bot.io (Linux m4)FailedFull output at http://54.241.84.105:8877/c83825082c92734/output.txt Total script time: 20.54 mins
Image differences available at: http://54.241.84.105:8877/c83825082c92734/reftest-analyzer.html#web=eq.log |
/botio-linux browsertest |
From: Bot.io (Linux m4)ReceivedCommand cmd_browsertest from @Snuffleupagus received. Current queue size: 0 Live output at: http://54.241.84.105:8877/ab3726b8d764bf0/output.txt |
/botio-linux browsertest |
From: Bot.io (Linux m4)ReceivedCommand cmd_browsertest from @Snuffleupagus received. Current queue size: 1 Live output at: http://54.241.84.105:8877/34f0956cd336db0/output.txt |
From: Bot.io (Windows)FailedFull output at http://54.193.163.58:8877/bf70a22fa6671f6/output.txt Total script time: 41.08 mins
Image differences available at: http://54.193.163.58:8877/bf70a22fa6671f6/reftest-analyzer.html#web=eq.log |
From: Bot.io (Linux m4)FailedFull output at http://54.241.84.105:8877/ab3726b8d764bf0/output.txt Total script time: 17.41 mins
Image differences available at: http://54.241.84.105:8877/ab3726b8d764bf0/reftest-analyzer.html#web=eq.log |
From: Bot.io (Linux m4)FailedFull output at http://54.241.84.105:8877/34f0956cd336db0/output.txt Total script time: 19.68 mins
Image differences available at: http://54.241.84.105:8877/34f0956cd336db0/reftest-analyzer.html#web=eq.log |
/botio makeref |
From: Bot.io (Linux m4)ReceivedCommand cmd_makeref from @Snuffleupagus received. Current queue size: 0 Live output at: http://54.241.84.105:8877/e3cf3a779157b33/output.txt |
From: Bot.io (Windows)ReceivedCommand cmd_makeref from @Snuffleupagus received. Current queue size: 0 Live output at: http://54.193.163.58:8877/5d052090f7c4a9a/output.txt |
/botio-linux makeref |
From: Bot.io (Linux m4)ReceivedCommand cmd_makeref from @Snuffleupagus received. Current queue size: 1 Live output at: http://54.241.84.105:8877/0a91d46fb4fa029/output.txt |
From: Bot.io (Linux m4)FailedFull output at http://54.241.84.105:8877/e3cf3a779157b33/output.txt Total script time: 18.07 mins
|
From: Bot.io (Windows)SuccessFull output at http://54.193.163.58:8877/5d052090f7c4a9a/output.txt Total script time: 37.66 mins
|
From: Bot.io (Linux m4)SuccessFull output at http://54.241.84.105:8877/0a91d46fb4fa029/output.txt Total script time: 20.37 mins
|
In the referenced bug, the embedded fonts contain custom CMap-data that only include strings. Note how for embedded composite TrueType fonts we're using the CMap-data when building the glyph mapping, and currently we end up with a completely empty map because the code expects only CID numbers.
Furthermore, just fixing the glyph mapping alone isn't sufficient to fully address the bug, since we also need to consider this "special" kind of CMap-data when looking up glyph widths.
Fixes https://bugzilla.mozilla.org/show_bug.cgi?id=920426