-
Notifications
You must be signed in to change notification settings - Fork 10.2k
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
Parse the font file to determine the correct type/subtype, rather than relying on the (often incorrect) data in the font dictionary #9961
Conversation
2d11d82
to
59130f8
Compare
Since I've not run any tests locally, I suppose that this could all fail spectacularly :-) /botio test |
From: Bot.io (Linux m4)ReceivedCommand cmd_test from @Snuffleupagus received. Current queue size: 0 Live output at: http://54.67.70.0:8877/f0223b1439add40/output.txt |
From: Bot.io (Windows)ReceivedCommand cmd_test from @Snuffleupagus received. Current queue size: 0 Live output at: http://54.215.176.217:8877/31cfe6bf0474055/output.txt |
From: Bot.io (Windows)FailedFull output at http://54.215.176.217:8877/31cfe6bf0474055/output.txt Total script time: 28.26 mins
Image differences available at: http://54.215.176.217:8877/31cfe6bf0474055/reftest-analyzer.html#web=eq.log |
From: Bot.io (Linux m4)FailedFull output at http://54.67.70.0:8877/f0223b1439add40/output.txt Total script time: 35.84 mins
Image differences available at: http://54.67.70.0:8877/f0223b1439add40/reftest-analyzer.html#web=eq.log |
The failures should hopefully all be caused by a pre-existing existing, since the /botio test |
From: Bot.io (Linux m4)ReceivedCommand cmd_test from @Snuffleupagus received. Current queue size: 0 Live output at: http://54.67.70.0:8877/fa6d144f1ee0ca8/output.txt |
From: Bot.io (Windows)ReceivedCommand cmd_test from @Snuffleupagus received. Current queue size: 0 Live output at: http://54.215.176.217:8877/1e43c45a6f0fe7c/output.txt |
From: Bot.io (Windows)SuccessFull output at http://54.215.176.217:8877/1e43c45a6f0fe7c/output.txt Total script time: 28.13 mins
|
From: Bot.io (Linux m4)SuccessFull output at http://54.67.70.0:8877/fa6d144f1ee0ca8/output.txt Total script time: 36.04 mins
|
d0c60a5
to
521070f
Compare
9e57a80
to
18b9c5b
Compare
…cific header 'true' Please refer to the TrueType specification: https://developer.apple.com/fonts/TrueType-Reference-Manual/RM06/Chap6.html#ScalerTypeNote
e8714c5
to
189fa4d
Compare
Compared to most other font formats, the CFF doesn't have a constant header which makes is slightly more difficult to detect such font files. Please refer to the Compact Font Format specification: https://www.adobe.com/content/dam/acom/en/devnet/font/pdfs/5176.CFF.pdf#G3.32094
…n relying on the (often incorrect) data in the font dictionary The current font type/subtype detection code is quite inconsistent/unwieldy. In some cases it will simply assume that the font dictionary is correct, in others it will somewhat "arbitrarily" check the actual font file (more of these cases have been added over the years to fix specific bugs). As is evident from e.g. issue 9949, the font type/subtype detection code is continuing to cause issues. In an attempt to get rid of these hacks once and for all, this patch instead re-factors the type/subtype detection to *always* parse the font file. Please note that, as far as I can tell, we still appear to need to rely on the composite font detection based on the font dictionary. However, even if the composite/non-composite detection would get it wrong, that shouldn't really matter too much given that there's basically only two different code-paths (for "TrueType-like" vs "Type1-like" fonts).
189fa4d
to
3177f6a
Compare
/botio test |
From: Bot.io (Linux m4)ReceivedCommand cmd_test from @Snuffleupagus received. Current queue size: 0 Live output at: http://54.67.70.0:8877/475437f1133487f/output.txt |
From: Bot.io (Windows)ReceivedCommand cmd_test from @Snuffleupagus received. Current queue size: 0 Live output at: http://54.215.176.217:8877/f121e937e602f73/output.txt |
From: Bot.io (Windows)SuccessFull output at http://54.215.176.217:8877/f121e937e602f73/output.txt Total script time: 28.22 mins
|
From: Bot.io (Linux m4)SuccessFull output at http://54.67.70.0:8877/475437f1133487f/output.txt Total script time: 35.44 mins
|
/botio-linux preview |
From: Bot.io (Linux m4)ReceivedCommand cmd_preview from @timvandermeij received. Current queue size: 0 Live output at: http://54.67.70.0:8877/a981105c1fd19e7/output.txt |
From: Bot.io (Linux m4)SuccessFull output at http://54.67.70.0:8877/a981105c1fd19e7/output.txt Total script time: 6.91 mins Published |
Thank you for improving this; much more readable this way and I verified that it fixes the issue too. |
Another possibility is doing something like tx and peek into the file: |
But... that's what this PR does :-) The newly added Lines 656 to 700 in c8ee633
|
Hah, okay, I was lazy and didn't look into what all the |
The current font type/subtype detection code is quite inconsistent/unwieldy. In some cases it will simply assume that the font dictionary is correct, in others it will somewhat "arbitrarily" check the actual font file (more of these cases have been added over the years to fix specific bugs).
As is evident from e.g. issue #9949, the font type/subtype detection code is continuing to cause issues. In an attempt to get rid of these hacks once and for all, this patch instead re-factors the type/subtype detection to always parse the font file.
Please note that, as far as I can tell, we still appear to need to rely on the composite font detection based on the font dictionary. However, even if the composite/non-composite detection would get it wrong, that shouldn't really matter too much given that there's basically only two different code-paths (for "TrueType-like" vs "Type1-like" fonts).
This PR provides a complete fix for issue #9949, in addition to the generally useful workaround implemented by PR #9958. Furthermore, this PR also ought to prevent any future font type/subtype detection bugs too.