-
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 basic support for non-embedded Wingdings fonts #5463
Conversation
/botio-linux preview |
From: Bot.io (Linux)ReceivedCommand cmd_preview from @Snuffleupagus received. Current queue size: 0 Live output at: http://107.21.233.14:8877/5f1c69575a56166/output.txt |
From: Bot.io (Linux)SuccessFull output at http://107.21.233.14:8877/5f1c69575a56166/output.txt Total script time: 0.77 mins Published
|
@@ -1310,7 +1310,8 @@ var PartialEvaluator = (function PartialEvaluatorClosure() { | |||
if (!properties.file) { | |||
if (/Symbol/i.test(properties.name)) { | |||
encoding = Encodings.SymbolSetEncoding; | |||
} else if (/Dingbats/i.test(properties.name)) { | |||
} else if (/Dingbats/i.test(properties.name) || | |||
/Wingdings/i.test(properties.name)) { |
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.
Collapse the two regular expressions into one: /Dingbats|Wingdings/i
(also in fonts.js)
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.
Done, thanks!
/botio test |
From: Bot.io (Windows)ReceivedCommand cmd_test from @Snuffleupagus received. Current queue size: 0 Live output at: http://107.22.172.223:8877/d789d02b3b6706e/output.txt |
From: Bot.io (Linux)ReceivedCommand cmd_test from @Snuffleupagus received. Current queue size: 0 Live output at: http://107.21.233.14:8877/3cabcda031a3967/output.txt |
From: Bot.io (Windows)FailedFull output at http://107.22.172.223:8877/d789d02b3b6706e/output.txt Total script time: 2.98 mins
Image differences available at: http://107.22.172.223:8877/d789d02b3b6706e/reftest-analyzer.html#web=eq.log |
From: Bot.io (Linux)FailedFull output at http://107.21.233.14:8877/3cabcda031a3967/output.txt Total script time: 23.55 mins
Image differences available at: http://107.21.233.14:8877/3cabcda031a3967/reftest-analyzer.html#web=eq.log |
really good, however I think the best place for that is nonStdFontMap. will it be possible to redo the logic based on that? |
That seems to works just as well. Is the updated patch more in line with what you had in mind? |
Yeah, something like that. I was actually curious if we still need changes in the symbolsFonts and the warning. |
I figured the warning was a good idea since, as I noted above, this PR isn't a complete solution for Wingdings support (but good enough for now in my opinion). Edit: Sorry, I missed your comment about |
The patch makes sense to me. I think the warning is fine in case the substitution is not perfect and people report an issue about it. It will give us a clue about what the issue is and how often it occurs, and it should not disturb the regular user if it's only visible in the console. Good to go? |
@@ -2500,6 +2501,10 @@ var Font = (function FontClosure() { | |||
this.toFontChar[charCode] = fontChar; | |||
} | |||
} else if (/Dingbats/i.test(fontName)) { | |||
if (name.search(/Wingdings/i) !== -1) { |
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.
Use /Windings/i.test(name)
instead of name.search() !== -1
.
This is a tentative patch that adds *very* basic support for non-embedded Wingdings fonts (a Windows version of Dingbats), by falling back to the ZapfDingbats encoding. Obviously this approach will not work perfectly, but in my opinion it seems to work reasonably well in pratice. Instead of this very simple patch, another option would be to try and include more complete glyph data for Wingdings, e.g. a Unicode map and glyph widths, similar to what was done for ZapfDingbats. However there is, in my opinion, one important difference between Wingdings and ZapfDingbats: ZapfDingbats is part of the 14 standard fonts, which in previous versions of the PDF specification was assumed to be available in PDF readers. To improve compatibility with older files, it thus makes sense for us to include data for ZapfDingbats. However Wingdings has never been a standard font in PDF files, hence PDF files using it *should* thus contain all the necessary font data. Given the above, I thus believe that it should be OK to fall back to ZapfDingbats for now. If non-embedded Wingdings fonts turns out to be *a lot* more common, then we can revisit this later. Fixes 4301 completely. Fixes 4837 almost completely. With this patch the bullets are displayed correctly, but the arrows are not of the correct type. Fixes `artofwar.pdf`, pages 14 and 15.
/botio test |
From: Bot.io (Windows)ReceivedCommand cmd_test from @timvandermeij received. Current queue size: 0 Live output at: http://107.22.172.223:8877/c94595481d2c7e2/output.txt |
From: Bot.io (Linux)ReceivedCommand cmd_test from @timvandermeij received. Current queue size: 0 Live output at: http://107.21.233.14:8877/f1865b9460f8a38/output.txt |
From: Bot.io (Windows)FailedFull output at http://107.22.172.223:8877/c94595481d2c7e2/output.txt Total script time: 17.11 mins
Image differences available at: http://107.22.172.223:8877/c94595481d2c7e2/reftest-analyzer.html#web=eq.log |
From: Bot.io (Linux)FailedFull output at http://107.21.233.14:8877/f1865b9460f8a38/output.txt Total script time: 22.38 mins
Image differences available at: http://107.21.233.14:8877/f1865b9460f8a38/reftest-analyzer.html#web=eq.log |
/botio makeref Thank you |
From: Bot.io (Windows)ReceivedCommand cmd_makeref from @yurydelendik received. Current queue size: 0 Live output at: http://107.22.172.223:8877/649b044d23edc1f/output.txt |
From: Bot.io (Linux)ReceivedCommand cmd_makeref from @yurydelendik received. Current queue size: 0 Live output at: http://107.21.233.14:8877/63c4f85855903de/output.txt |
Add basic support for non-embedded Wingdings fonts
From: Bot.io (Windows)SuccessFull output at http://107.22.172.223:8877/649b044d23edc1f/output.txt Total script time: 17.38 mins
|
From: Bot.io (Linux)SuccessFull output at http://107.21.233.14:8877/63c4f85855903de/output.txt Total script time: 22.65 mins
|
Add basic support for non-embedded Wingdings fonts
This is a tentative patch that adds very basic support for non-embedded Wingdings fonts (a Windows version of Dingbats), by falling back to the ZapfDingbats encoding. Obviously this approach will not work perfectly, but in my opinion it seems to work reasonably well in pratice.
Instead of this very simple patch, another option would be to try and include more complete glyph data for Wingdings, e.g. a Unicode map and glyph widths, similar to what was done for ZapfDingbats.
However there is, in my opinion, one important difference between Wingdings and ZapfDingbats: ZapfDingbats is part of the 14 standard fonts, which in previous versions of the PDF specification was assumed to be available in PDF readers. To improve compatibility with older files, it thus makes sense for us to include data for ZapfDingbats.
However Wingdings has never been a standard font in PDF files, hence PDF files using it should thus contain all the necessary font data.
Given the above, I thus believe that it should be OK to fall back to ZapfDingbats for now. If non-embedded Wingdings fonts turns out to be a lot more common, then we can revisit this later.
Fixes #4301 completely.
Fixes #4837 almost completely. With this patch the bullets are displayed correctly, but the arrows are not of the correct type.
Fixes
artofwar.pdf
, pages 14 and 15.