-
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
Add unique glyph names for CFF fonts. #10591
Conversation
/botio test |
From: Bot.io (Windows)ReceivedCommand cmd_test from @brendandahl received. Current queue size: 0 Live output at: http://54.215.176.217:8877/20248ab9d595e55/output.txt |
From: Bot.io (Linux m4)ReceivedCommand cmd_test from @brendandahl received. Current queue size: 0 Live output at: http://54.67.70.0:8877/1ba0856f1392631/output.txt |
From: Bot.io (Linux m4)FailedFull output at http://54.67.70.0:8877/1ba0856f1392631/output.txt Total script time: 18.01 mins
Image differences available at: http://54.67.70.0:8877/1ba0856f1392631/reftest-analyzer.html#web=eq.log |
From: Bot.io (Windows)FailedFull output at http://54.215.176.217:8877/20248ab9d595e55/output.txt Total script time: 25.62 mins
Image differences available at: http://54.215.176.217:8877/20248ab9d595e55/reftest-analyzer.html#web=eq.log |
293fab1
to
9f25370
Compare
/botio test |
From: Bot.io (Linux m4)ReceivedCommand cmd_test from @brendandahl received. Current queue size: 0 Live output at: http://54.67.70.0:8877/a0f05cd31dfd317/output.txt |
From: Bot.io (Windows)ReceivedCommand cmd_test from @brendandahl received. Current queue size: 0 Live output at: http://54.215.176.217:8877/125fff818aecc56/output.txt |
From: Bot.io (Linux m4)FailedFull output at http://54.67.70.0:8877/a0f05cd31dfd317/output.txt Total script time: 17.96 mins
|
From: Bot.io (Windows)FailedFull output at http://54.215.176.217:8877/125fff818aecc56/output.txt Total script time: 25.41 mins
Image differences available at: http://54.215.176.217:8877/125fff818aecc56/reftest-analyzer.html#web=eq.log |
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.
I'm assuming that testing this would be difficult in general, given that it's MacOS specific, but could e.g. a unit-test be added to avoid future regressions?
src/core/cff_parser.js
Outdated
@@ -1295,6 +1298,17 @@ var CFFCompiler = (function CFFCompilerClosure() { | |||
output.add(compiled.output); | |||
var topDictTracker = compiled.trackers[0]; | |||
|
|||
// Create names for all of the glyphs so they can be put in the charset | |||
// below. | |||
let firstGlyphSid = cff.strings.strings.length + NUM_STANDARD_CFF_STRINGS; |
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.
Nit: Assuming that cff.strings
is an instance of CFFStrings
, you should be able to use
Lines 945 to 947 in df7756d
get count() { | |
return this.strings.length; | |
}, |
let firstGlyphSid = cff.strings.count + NUM_STANDARD_CFF_STRINGS;
Printing on MacOS was broken with the previous approach of just mapping all the glyphs to notdef.
9f25370
to
8a596ef
Compare
Yeah, even more difficult since this issue only seems to happen with printing on MacOS. Added a unit test. |
/botio test |
From: Bot.io (Linux m4)ReceivedCommand cmd_test from @brendandahl received. Current queue size: 0 Live output at: http://54.67.70.0:8877/e0cd5d81ed87e61/output.txt |
From: Bot.io (Windows)ReceivedCommand cmd_test from @brendandahl received. Current queue size: 0 Live output at: http://54.215.176.217:8877/79a98c1e8a5addd/output.txt |
From: Bot.io (Linux m4)FailedFull output at http://54.67.70.0:8877/e0cd5d81ed87e61/output.txt Total script time: 18.02 mins
|
From: Bot.io (Windows)SuccessFull output at http://54.215.176.217:8877/79a98c1e8a5addd/output.txt Total script time: 25.57 mins
|
@Snuffleupagus Could you perhaps re-check this now that changes have been made? |
sid = strings.getSID(name); | ||
if (sid === -1) { | ||
sid = 0; | ||
warn(`Couldn't find ${name} in CFF strings`); |
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.
@brendandahl This seem to have caused a lot of warning "spam" in the console even for something as simple as e.g. the default tracemonkey.pdf
file.
From a cursory look it appears that charset.charset
only contains numbers, and not strings, for many PDF files.
Summary: Includes pdf.js pull requests: mozilla/pdf.js#10591 mozilla/pdf.js#10604 Reviewers: yury Reviewed By: yury Bug #: 1530881 Differential Revision: https://phabricator.services.mozilla.com/D22131 --HG-- extra : rebase_source : a325a575ce4511bfa37c899411ece4fac17d6900 extra : histedit_source : d3026260dd6701c4def4c0e74ad84516c138b292
Summary: Includes pdf.js pull requests: mozilla/pdf.js#10591 mozilla/pdf.js#10604 Reviewers: yury Reviewed By: yury Bug #: 1530881 Differential Revision: https://phabricator.services.mozilla.com/D22131
Printing CFF fonts on MacOS was broken with the previous approach of just mapping
all the glyphs to notdef.
Fixes:
https://bugzilla.mozilla.org/show_bug.cgi?id=880181
https://bugzilla.mozilla.org/show_bug.cgi?id=1523991
https://bugzilla.mozilla.org/show_bug.cgi?id=1523667
https://bugzilla.mozilla.org/show_bug.cgi?id=1524367