-
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
Don't blindly trust toUnicode when building toFontChar for non-standard fonts without a font file (issue 4934) #4944
Conversation
…rd fonts without a font file (issue 4934)
/botio-windows preview |
From: Bot.io (Windows)ReceivedCommand cmd_preview from @Snuffleupagus received. Current queue size: 0 Live output at: http://107.22.172.223:8877/c119493971abd15/output.txt |
From: Bot.io (Windows)SuccessFull output at http://107.22.172.223:8877/c119493971abd15/output.txt Total script time: 0.90 mins Published
|
/botio test |
From: Bot.io (Linux)ReceivedCommand cmd_test from @Snuffleupagus received. Current queue size: 0 Live output at: http://107.21.233.14:8877/d40e48ca2b05a7b/output.txt |
From: Bot.io (Windows)ReceivedCommand cmd_test from @Snuffleupagus received. Current queue size: 0 Live output at: http://107.22.172.223:8877/61ec97f4cb43baa/output.txt |
From: Bot.io (Windows)SuccessFull output at http://107.22.172.223:8877/61ec97f4cb43baa/output.txt Total script time: 20.94 mins
|
From: Bot.io (Linux)SuccessFull output at http://107.21.233.14:8877/d40e48ca2b05a7b/output.txt Total script time: 24.63 mins
|
/botio makeref |
From: Bot.io (Linux)ReceivedCommand cmd_makeref from @yurydelendik received. Current queue size: 0 Live output at: http://107.21.233.14:8877/74f4f98365f0c81/output.txt |
From: Bot.io (Windows)ReceivedCommand cmd_makeref from @yurydelendik received. Current queue size: 0 Live output at: http://107.22.172.223:8877/5ccb3ca5a34ef7e/output.txt |
Thank you for the fix |
Don't blindly trust toUnicode when building toFontChar for non-standard fonts without a font file (issue 4934)
From: Bot.io (Windows)SuccessFull output at http://107.22.172.223:8877/5ccb3ca5a34ef7e/output.txt Total script time: 21.16 mins
|
From: Bot.io (Linux)SuccessFull output at http://107.21.233.14:8877/74f4f98365f0c81/output.txt Total script time: 23.83 mins
|
This PR does fix the issue, and it passes all tests locally, however I am really not sure if this is the correct way to solve the issue.
For non-standard fonts without font files, relying solely on
toUnicode
when buildingtoFontChar
can be problematic sincetoUnicode
may contain strange/bogus entries.In the PDF file in the issue referenced below,
toUnicode
actually maps most upper-case letters to their lower-case versions.I've attempted to solve this by instead checking if
differences
ordefaultEncoding
exist and, if so, use them before accepting atoUnicode
entry.Please note: this breaks the character mapping when used with
CIDFontType
fonts, hence it's not used in those cases. This distinction seemed somewhat arbitrary, but before PR #4259 those fonts were apparently handled slightly differently than other fonts e.g. incharToGlyph
.Fixes #4934.