-
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
Allow FontFaceObject.getPathGenerator
to ignore non-embedded fonts during rendering
#9809
Allow FontFaceObject.getPathGenerator
to ignore non-embedded fonts during rendering
#9809
Conversation
… `InternalRenderTask._scheduleNext` To support these changes, `InternalRenderTask._next` now returns a Promise.
- Reduce the overall indentation level, by making use of early returns. - Replace `var` with `let`.
…r, and utilize it in `getPathGenerator` to ignore missing glyphs Obviously it's still not possible to render non-embedded fonts as paths, but in this way the rest of the page will at least be allowed to continue rendering. *Please note:* Including the 14 standard fonts in PDF.js probably wouldn't be *that* difficult to implement. (I'm not a lawyer, but the fonts from PDFium could probably be used given their BSD license.) However, the main blocker ought to be the total size of the necessary font data, since I cannot imagine people being OK with shipping ~5 MB of (additional) font data with Firefox. (Based on the reactions when the CMap files were added, and those are only ~1 MB in size.)
…ntFaceObject.getPathGenerator`
/botio test |
From: Bot.io (Linux m4)ReceivedCommand cmd_test from @Snuffleupagus received. Current queue size: 0 Live output at: http://54.67.70.0:8877/92076e2853494f1/output.txt |
From: Bot.io (Windows)ReceivedCommand cmd_test from @Snuffleupagus received. Current queue size: 0 Live output at: http://54.215.176.217:8877/358819db1ba519e/output.txt |
From: Bot.io (Windows)FailedFull output at http://54.215.176.217:8877/358819db1ba519e/output.txt Total script time: 23.67 mins
Image differences available at: http://54.215.176.217:8877/358819db1ba519e/reftest-analyzer.html#web=eq.log |
From: Bot.io (Linux m4)SuccessFull output at http://54.67.70.0:8877/92076e2853494f1/output.txt Total script time: 38.67 mins
|
Something I noticed while looking at this quickly: why do we need the unsupported feature commit exactly? Either we're throwing errors or printing warnings, but in both cases they should end up in the console, which is where the unsupported feature message will be too AFAICT. Wouldn't that result in two messages for the same exception, or is the unsupported feature meant for e.g., the extension? |
For the native Firefox notification bar, please see Lines 760 to 761 in b590519
MOZCENTRAL specific code-path in Lines 825 to 844 in b590519
Hence |
/botio-linux preview |
From: Bot.io (Linux m4)ReceivedCommand cmd_preview from @timvandermeij received. Current queue size: 0 Live output at: http://54.67.70.0:8877/80b52a2e130cc3b/output.txt |
From: Bot.io (Linux m4)SuccessFull output at http://54.67.70.0:8877/80b52a2e130cc3b/output.txt Total script time: 8.31 mins Published |
/botio makeref |
From: Bot.io (Linux m4)ReceivedCommand cmd_makeref from @timvandermeij received. Current queue size: 0 Live output at: http://54.67.70.0:8877/e810ef777e21e02/output.txt |
From: Bot.io (Windows)ReceivedCommand cmd_makeref from @timvandermeij received. Current queue size: 0 Live output at: http://54.215.176.217:8877/6ca063f21fab6d3/output.txt |
From: Bot.io (Windows)SuccessFull output at http://54.215.176.217:8877/6ca063f21fab6d3/output.txt Total script time: 21.17 mins
|
From: Bot.io (Linux m4)SuccessFull output at http://54.67.70.0:8877/e810ef777e21e02/output.txt Total script time: 35.54 mins
|
Really good that rendering now continues; thanks! |
…gnoreErrors Allow `FontFaceObject.getPathGenerator` to ignore non-embedded fonts during rendering
This fixes, first of all, the inconsistent error handling that PR #9689 introduced in
InternalRenderTask._scheduleNext
. With the code currently inmaster
, a "regular" canvas rendering operation is still left in a perpetually pending state if an error is thrown at any point during rendering (leading to a permanent spinner in the viewer).Furthermore, rather than stopping all rendering when attempting to draw non-embedded fonts as paths, the
FontFaceObject.getPathGenerator
method is now able to ignore errors[1] and let rendering continue with a warning/notification.Please note: While this provides a (perhaps) slightly less jarring behaviour for issue #4244 (and its duplicates), keep in mind that the only "real" solution would be to start shipping standard fonts with the PDF.js library.
[1] Similar to PRs #8240 and #8922, this is all controlled with the
stopAtErrors
parameter; please seepdf.js/src/display/api.js
Lines 154 to 157 in 2030d17