-
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
Prevent readCmapTable
from failing if the cmap
is missing in TrueType fonts
#6607
Prevent readCmapTable
from failing if the cmap
is missing in TrueType fonts
#6607
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/c36d365511bc542/output.txt |
From: Bot.io (Linux)SuccessFull output at http://107.21.233.14:8877/c36d365511bc542/output.txt Total script time: 0.76 mins Published |
@@ -3227,7 +3227,7 @@ var Font = (function FontClosure() { | |||
*/ | |||
function readCmapTable(cmap, font, isSymbolicFont, hasEncoding) { | |||
var segment; | |||
var start = (font.start ? font.start : 0) + cmap.offset; | |||
var start = (font.start ? font.start : 0) + (cmap ? cmap.offset : 0); |
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.
Handle this special case in the caller -- I don't think we shall read any data below.
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 think that that would become messy on the caller side, since we're relying on readCmapTable
to return something in order for the glyph mapping to work (see https://github.com/mozilla/pdf.js/blob/master/src/core/fonts.js#L4224-L4229 and below).
How about the updated version of the patch, which returns immediately for this (hopefully) rare case?
looks good. /botio test |
From: Bot.io (Windows)ReceivedCommand cmd_test from @yurydelendik received. Current queue size: 0 Live output at: http://107.22.172.223:8877/8fc89f00be7fdd8/output.txt |
From: Bot.io (Linux)ReceivedCommand cmd_test from @yurydelendik received. Current queue size: 0 Live output at: http://107.21.233.14:8877/6afc0ec272ec4ca/output.txt |
From: Bot.io (Windows)SuccessFull output at http://107.22.172.223:8877/8fc89f00be7fdd8/output.txt Total script time: 18.64 mins
|
From: Bot.io (Linux)SuccessFull output at http://107.21.233.14:8877/6afc0ec272ec4ca/output.txt Total script time: 20.13 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/40fe55676e1f7a1/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/4af951ec8c94a3f/output.txt |
Prevent `readCmapTable` from failing if the `cmap` is missing in TrueType fonts
thank you for the patch |
From: Bot.io (Windows)SuccessFull output at http://107.22.172.223:8877/4af951ec8c94a3f/output.txt Total script time: 19.02 mins
|
From: Bot.io (Linux)SuccessFull output at http://107.21.233.14:8877/40fe55676e1f7a1/output.txt Total script time: 20.03 mins
|
Fixes http://arrow.dit.ie/cgi/viewcontent.cgi?article=1000&context=aaschadpoth#page=3.