-
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
Improve how Type3-fonts with dependencies are handled #12127
Improve how Type3-fonts with dependencies are handled #12127
Conversation
aea5796
to
f93f5bc
Compare
From: Bot.io (Linux m4)ReceivedCommand cmd_test from @Snuffleupagus received. Current queue size: 0 Live output at: http://54.67.70.0:8877/68d3d452ddadcc8/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/7115c9c0d7f1210/output.txt |
From: Bot.io (Linux m4)FailedFull output at http://54.67.70.0:8877/68d3d452ddadcc8/output.txt Total script time: 26.79 mins
Image differences available at: http://54.67.70.0:8877/68d3d452ddadcc8/reftest-analyzer.html#web=eq.log |
From: Bot.io (Windows)FailedFull output at http://54.215.176.217:8877/7115c9c0d7f1210/output.txt Total script time: 30.74 mins
Image differences available at: http://54.215.176.217:8877/7115c9c0d7f1210/reftest-analyzer.html#web=eq.log |
87b9f59
to
4fad4d6
Compare
From: Bot.io (Linux m4)ReceivedCommand cmd_test from @Snuffleupagus received. Current queue size: 0 Live output at: http://54.67.70.0:8877/7302bbb0bf88ec0/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/659674c828cee10/output.txt |
From: Bot.io (Linux m4)FailedFull output at http://54.67.70.0:8877/7302bbb0bf88ec0/output.txt Total script time: 26.76 mins
Image differences available at: http://54.67.70.0:8877/7302bbb0bf88ec0/reftest-analyzer.html#web=eq.log |
From: Bot.io (Windows)FailedFull output at http://54.215.176.217:8877/659674c828cee10/output.txt Total script time: 31.17 mins
Image differences available at: http://54.215.176.217:8877/659674c828cee10/reftest-analyzer.html#web=eq.log |
This time there was an intermittent unit test failure on Windows too. I'm going to compile a list of the failures on the intermittent unit test failures issue. |
/botio unittest |
From: Bot.io (Linux m4)ReceivedCommand cmd_unittest from @Snuffleupagus received. Current queue size: 0 Live output at: http://54.67.70.0:8877/589794a9f1f0a46/output.txt |
From: Bot.io (Windows)ReceivedCommand cmd_unittest from @Snuffleupagus received. Current queue size: 0 Live output at: http://54.215.176.217:8877/898e1b806abe1ce/output.txt |
From: Bot.io (Linux m4)SuccessFull output at http://54.67.70.0:8877/589794a9f1f0a46/output.txt Total script time: 3.79 mins
|
From: Bot.io (Windows)SuccessFull output at http://54.215.176.217:8877/898e1b806abe1ce/output.txt Total script time: 4.95 mins
|
4fad4d6
to
19a1552
Compare
/botio test |
From: Bot.io (Linux m4)ReceivedCommand cmd_test from @timvandermeij received. Current queue size: 0 Live output at: http://54.67.70.0:8877/1c8be5305e71017/output.txt |
From: Bot.io (Windows)ReceivedCommand cmd_test from @timvandermeij received. Current queue size: 0 Live output at: http://54.215.176.217:8877/34988680d7a9fe6/output.txt |
From: Bot.io (Linux m4)FailedFull output at http://54.67.70.0:8877/1c8be5305e71017/output.txt Total script time: 26.88 mins
Image differences available at: http://54.67.70.0:8877/1c8be5305e71017/reftest-analyzer.html#web=eq.log |
From: Bot.io (Windows)FailedFull output at http://54.215.176.217:8877/34988680d7a9fe6/output.txt Total script time: 30.53 mins
Image differences available at: http://54.215.176.217:8877/34988680d7a9fe6/reftest-analyzer.html#web=eq.log |
While the `CharProcs` streams of Type3-fonts *usually* don't rely on dependencies, such as e.g. images, it does happen in some cases. Currently any dependencies are simply appended to the parent operatorList, which in practice means *only* the operatorList of the *first* page where the Type3-font is being used. However, there's one thing that's slightly unfortunate with that approach: Since fonts are global to the PDF document, we really ought to ensure that any Type3 dependencies are appended to the operatorList of *all* pages where the Type3-font is being used. Otherwise there's a theoretical risk that, if one page has its rendering paused, another page may try to use a Type3-font whose dependencies are not yet fully resolved. In that case there would be errors, since Type3 operatorLists are executed synchronously. Hence this patch, which ensures that all relevant pages will have Type3 dependencies appended to the main operatorList. (Note here that the `OperatorList.addDependencies` method, via `OperatorList.addDependency`, ensures that a dependency is only added *once* to any operatorList.) Finally, these changes also remove the need for the "waiting for the main-thread"-hack that was added to `PartialEvaluator.buildPaintImageXObject` as part of fixing issue 10717.
There's quite frankly no particular reason to special-case Type3-fonts with image resources, which are very rare anyway, now that we have a general mechanism for sending/receiving images globally.
…3Data` is called If the `TranslatedFont.type3Loaded` property exists, then you already know that the font must be a Type3 one.
47ff9f4
to
835b5ff
Compare
/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/65520c03a426d48/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/15a2f078ea5b43c/output.txt |
From: Bot.io (Linux m4)FailedFull output at http://54.67.70.0:8877/65520c03a426d48/output.txt Total script time: 26.69 mins
Image differences available at: http://54.67.70.0:8877/65520c03a426d48/reftest-analyzer.html#web=eq.log |
From: Bot.io (Windows)FailedFull output at http://54.215.176.217:8877/15a2f078ea5b43c/output.txt Total script time: 28.67 mins
Image differences available at: http://54.215.176.217:8877/15a2f078ea5b43c/reftest-analyzer.html#web=eq.log |
Looks good to me; thanks! |
While the
CharProcs
streams of Type3-fonts usually don't rely on dependencies, such as e.g. images, it does happen in some cases.Currently any dependencies are simply appended to the parent operatorList, which in practice means only the operatorList of the first page where the Type3-font is being used.
However, there's one thing that's slightly unfortunate with that approach: Since fonts are global to the PDF document, we really ought to ensure that any Type3 dependencies are appended to the operatorList of all pages where the Type3-font is being used. Otherwise there's a theoretical risk that, if one page has its rendering paused, another page may try to use a Type3-font whose dependencies are not yet fully resolved. In that case there would be errors, since Type3 operatorLists are executed synchronously.
Hence this patch, which ensures that all relevant pages will have Type3 dependencies appended to the main operatorList. (Note here that the
OperatorList.addDependencies
method, viaOperatorList.addDependency
, ensures that a dependency is only added once to any operatorList.)Finally, these changes also remove the need for the "waiting for the main-thread"-hack that was added to
PartialEvaluator.buildPaintImageXObject
as part of fixing issue 10717.