-
Notifications
You must be signed in to change notification settings - Fork 10.1k
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
[api-minor] Change the format of the fontName
-property, in defaultAppearanceData
, on Annotation-instances (PR 12831 follow-up)
#13169
Conversation
…AppearanceData`, on Annotation-instances (PR 12831 follow-up) Currently the `fontName`-property contains an actual /Name-instance, which is a problem given that its fallback value is an empty string; see https://github.com/mozilla/pdf.js/blob/ca7f546828603d15ac0975f6131669321bfccceb/src/core/default_appearance.js#L35 The reason that this is a problem can be seen in https://github.com/mozilla/pdf.js/blob/ca7f546828603d15ac0975f6131669321bfccceb/src/core/primitives.js#L30-L34, since an empty string short-circuits the cache. Essentially, in PDF documents, a /Name-instance cannot be empty and the way that the `DefaultAppearanceEvaluator` does things is unfortunately not entirely correct. Hence the `fontName`-property is changed to instead contain a string, rather than a /Name-instance, which simplifies the code overall. *Please note:* I'm tagging this patch with "[api-minor]", since PR 12831 is included in the current pre-release (although we're not using the `fontName`-property in the display-layer).
/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/ed3e8249e78d5d3/output.txt |
From: Bot.io (Windows)ReceivedCommand cmd_test from @Snuffleupagus received. Current queue size: 0 Live output at: http://3.101.106.178:8877/59c2f3a8c89eac8/output.txt |
From: Bot.io (Linux m4)FailedFull output at http://54.67.70.0:8877/ed3e8249e78d5d3/output.txt Total script time: 24.96 mins
Image differences available at: http://54.67.70.0:8877/ed3e8249e78d5d3/reftest-analyzer.html#web=eq.log |
From: Bot.io (Windows)FailedFull output at http://3.101.106.178:8877/59c2f3a8c89eac8/output.txt Total script time: 29.75 mins
Image differences available at: http://3.101.106.178:8877/59c2f3a8c89eac8/reftest-analyzer.html#web=eq.log |
/botio integrationtest |
From: Bot.io (Linux m4)ReceivedCommand cmd_integrationtest from @Snuffleupagus received. Current queue size: 0 Live output at: http://54.67.70.0:8877/03bf87aef8d645a/output.txt |
From: Bot.io (Windows)ReceivedCommand cmd_integrationtest from @Snuffleupagus received. Current queue size: 0 Live output at: http://3.101.106.178:8877/9ccf795ba7b10c1/output.txt |
From: Bot.io (Linux m4)FailedFull output at http://54.67.70.0:8877/03bf87aef8d645a/output.txt Total script time: 3.99 mins
|
From: Bot.io (Windows)SuccessFull output at http://3.101.106.178:8877/9ccf795ba7b10c1/output.txt Total script time: 5.07 mins
|
Thanks! |
Currently the
fontName
-property contains an actual /Name-instance, which is a problem given that its fallback value is an empty string; seepdf.js/src/core/default_appearance.js
Line 35 in ca7f546
The reason that this is a problem can be seen in
pdf.js/src/core/primitives.js
Lines 30 to 34 in ca7f546
DefaultAppearanceEvaluator
does things is unfortunately not entirely correct.Hence the
fontName
-property is changed to instead contain a string, rather than a /Name-instance, which simplifies the code overall.Please note: I'm tagging this patch with "[api-minor]", since PR #12831 is included in the current pre-release (although we're not using the
fontName
-property in the display-layer).