-
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
Make use of textAdvanceScale consistent during combineTextItems. Fix for #7878. #7879
Conversation
/botio-linux preview |
From: Bot.io (Linux)ReceivedCommand cmd_preview from @timvandermeij received. Current queue size: 0 Live output at: http://107.21.233.14:8877/77b19eac6be9ae1/output.txt |
From: Bot.io (Linux)SuccessFull output at http://107.21.233.14:8877/77b19eac6be9ae1/output.txt Total script time: 2.27 mins Published |
/botio test |
From: Bot.io (Windows)ReceivedCommand cmd_test from @timvandermeij received. Current queue size: 0 Live output at: http://107.22.172.223:8877/ed74e45fe736535/output.txt |
From: Bot.io (Linux)ReceivedCommand cmd_test from @timvandermeij received. Current queue size: 0 Live output at: http://107.21.233.14:8877/c720ff5dbd84647/output.txt |
From: Bot.io (Windows)FailedFull output at http://107.22.172.223:8877/ed74e45fe736535/output.txt Total script time: 26.45 mins
Image differences available at: http://107.22.172.223:8877/ed74e45fe736535/reftest-analyzer.html#web=eq.log |
From: Bot.io (Linux)FailedFull output at http://107.21.233.14:8877/c720ff5dbd84647/output.txt Total script time: 26.76 mins
Image differences available at: http://107.21.233.14:8877/c720ff5dbd84647/reftest-analyzer.html#web=eq.log |
The tests reveal some unexpected changes. In particular, |
@you are right about the issues with some files -- sorry for not noticing these. I tracked the issue down to the fact that I should mention that I do find the scaling operations that I removed a bit odd, and I don't quite understand mathematically how they correspond with the equations in section 9.4.4 "Text Space Details" of the PDF spec. I believe my new updates are in line with the provided text matrix equations, but I could be missing something. |
Looks good. Could you add the file from #7878 as a regression test? Check https://github.com/mozilla/pdf.js/pull/7714/files as an example of how to add a test case. You have to do three things: update When that is done, please squash the commits into one commit. See https://github.com/mozilla/pdf.js/wiki/Squashing-Commits for how to do that easily. Thanks! |
Sure, I'll make those changes. Is it best to name the new test file after the issue or to give it a more descriptive name? I've also just noticed that Do you suggest I look into the monospace detection as part of this PR or should I make a new issue? |
Issue number is preferred for referencing it later.
New PR would be best. |
…s for improved highlighting. Fixes mozilla#7878.
Squashed. Please let me know if anything else should be changed. Thanks! |
/botio-linux preview |
From: Bot.io (Linux)ReceivedCommand cmd_preview from @timvandermeij received. Current queue size: 0 Live output at: http://107.21.233.14:8877/b8d955a2ca1c613/output.txt |
From: Bot.io (Linux)SuccessFull output at http://107.21.233.14:8877/b8d955a2ca1c613/output.txt Total script time: 2.20 mins Published |
/botio test |
From: Bot.io (Windows)ReceivedCommand cmd_test from @timvandermeij received. Current queue size: 0 Live output at: http://107.22.172.223:8877/7f8db47a07acdba/output.txt |
From: Bot.io (Linux)ReceivedCommand cmd_test from @timvandermeij received. Current queue size: 0 Live output at: http://107.21.233.14:8877/1d42593fde57d1c/output.txt |
From: Bot.io (Windows)FailedFull output at http://107.22.172.223:8877/7f8db47a07acdba/output.txt Total script time: 26.01 mins
Image differences available at: http://107.22.172.223:8877/7f8db47a07acdba/reftest-analyzer.html#web=eq.log |
From: Bot.io (Linux)FailedFull output at http://107.21.233.14:8877/1d42593fde57d1c/output.txt Total script time: 26.28 mins
Image differences available at: http://107.21.233.14:8877/1d42593fde57d1c/reftest-analyzer.html#web=eq.log |
/botio makeref Thank you for the patch! |
From: Bot.io (Linux)ReceivedCommand cmd_makeref from @yurydelendik received. Current queue size: 0 Live output at: http://107.21.233.14:8877/1380ed48fb3de45/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/024b0ad867c5812/output.txt |
From: Bot.io (Linux)SuccessFull output at http://107.21.233.14:8877/1380ed48fb3de45/output.txt Total script time: 24.98 mins
|
From: Bot.io (Windows)SuccessFull output at http://107.22.172.223:8877/024b0ad867c5812/output.txt Total script time: 25.49 mins
|
Make use of textAdvanceScale consistent during combineTextItems. Fix for mozilla#7878.
Currently, while generating the text content of a page, multiple text draw operations may be combined into a single
textContentItem
. The running size of thistextContentItem
is kept as text is added and as the text transformation is changed; however, the summing of this size inconsistently applies thetextAdvanceScale
factor.This pull request fixes the discrepancy by only using the
textAdvanceScale
upon completion / flushing of thetextContentItem
. The result is that thetextContentItem
's size is calculated correctly, improving text highlighting in cases like #7878.More details:
Currently,
textAdvanceScale
is applied when adding the width / height of actual text content here. ThetextAdvanceScale
is not applied when accounting for size changes due to text advance transformation changes, such as here.I believe this issue might not appear often as it requires there to be a non-zero difference between the text advance distance and the previously calculated
lastAdvanceWidth
in order for the non-application of the scaling factor to have an effect.