-
Notifications
You must be signed in to change notification settings - Fork 10k
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
Only compile Type3 glyphs when Path2D
is supported
#15306
Conversation
According to MDN `Path2D` is available in all browsers that we currently support, see https://developer.mozilla.org/en-US/docs/Web/API/Path2D#browser_compatibility Hence only Node.js is currently lagging behind here, and requires that we keep the old code as a fallback in the `compileType3Glyph` function. However, there's an open PR in the `node-canvas` repository for adding `Path2D` support. As far as I'm concerned, there's two possible solutions here: - We land this patch now, since it removes unnecessary code in e.g. the Firefox PDF Viewer, which means that compilation of Type3 glyphs will be disabled in Node.js until that PR is landed.[1] If users report bugs about Type3 glyphs looking "inconsistent" in Node.js and/or being slow to render, we could perhaps encourage them to upvote and otherwise help out getting that PR landed? - We wait for the mentioned PR to land *first*, before moving forward with this patch. Given that there's been no updates on that PR for almost two months, this alternative may possibly take a while. --- [1] Note that Type3 fonts are first of all not very common in PDF documents, and secondly that compilation only applies specifically to Type3 glyphs that contain /ImageMask-data (i.e. not all Type3 fonts are affected).
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.
From my Firefox point of view, this patch looks good to me.
/botio test |
From: Bot.io (Linux m4)ReceivedCommand cmd_test from @timvandermeij received. Current queue size: 0 Live output at: http://54.241.84.105:8877/ddd6529417b003e/output.txt |
From: Bot.io (Windows)ReceivedCommand cmd_test from @timvandermeij received. Current queue size: 0 Live output at: http://54.193.163.58:8877/90b48f672c5de8a/output.txt |
From: Bot.io (Windows)FailedFull output at http://54.193.163.58:8877/90b48f672c5de8a/output.txt Total script time: 25.86 mins
|
From: Bot.io (Linux m4)FailedFull output at http://54.241.84.105:8877/ddd6529417b003e/output.txt Total script time: 26.79 mins
Image differences available at: http://54.241.84.105:8877/ddd6529417b003e/reftest-analyzer.html#web=eq.log |
Thanks! |
According to MDN
Path2D
is available in all browsers that we currently support, see https://developer.mozilla.org/en-US/docs/Web/API/Path2D#browser_compatibilityHence only Node.js is currently lagging behind here, and requires that we keep the old code as a fallback in the
compileType3Glyph
function. However, there's an open PR in thenode-canvas
repository for addingPath2D
support; please see Automattic/node-canvas#2013As far as I'm concerned, there's two possible solutions here:
We land this patch now, since it removes unnecessary code in e.g. the Firefox PDF Viewer, which means that compilation of Type3 glyphs will be disabled in Node.js until that PR is landed.[1]
If users report bugs about Type3 glyphs looking "inconsistent" in Node.js and/or being slow to render, we could perhaps encourage them to upvote and otherwise help out getting that PR landed?
We wait for the mentioned PR to land first, before moving forward with this patch. Given that there's been no updates on that PR for almost two months, this alternative may possibly take a while.
[1] Note that Type3 fonts are first of all not very common in PDF documents, and secondly that compilation only applies specifically to Type3 glyphs that contain /ImageMask-data (i.e. not all Type3 fonts are affected).