-
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
[api-minor] Fix issues in text selection #13424
Conversation
/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/ba7e5367fe2761d/output.txt |
From: Bot.io (Windows)ReceivedCommand cmd_test from @timvandermeij received. Current queue size: 1 Live output at: http://3.101.106.178:8877/ff49f0a56667729/output.txt |
From: Bot.io (Linux m4)FailedFull output at http://54.67.70.0:8877/ba7e5367fe2761d/output.txt Total script time: 25.83 mins
Image differences available at: http://54.67.70.0:8877/ba7e5367fe2761d/reftest-analyzer.html#web=eq.log |
From: Bot.io (Windows)FailedFull output at http://3.101.106.178:8877/ff49f0a56667729/output.txt Total script time: 30.32 mins
Image differences available at: http://3.101.106.178:8877/ff49f0a56667729/reftest-analyzer.html#web=eq.log |
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.
Unfortunately this patch causes rendering regressions in eq
-tests, and those tests should definitely not be changing for a text-selection only patch (see a possibly incomplete list below). My guess is that the src/core/fonts.js
changes are not generally appropriate and/or correct here.
- bug921760
- issue9949
- issue6127
- font_ascent_descent (slight movement)
- issue6737 (slight movement)
There's also some text
-tests which looks slightly worse than before, some examples include:
- tracemonkey-text-page14
- issue11713
- issue6019
- issue5972
- issue3925
fe968b1
to
a008b8a
Compare
They should be fixed now (I reverted changes in
There's slightly less spans so it implies a shift between canvas and text layer.
There no font change between sigmas but scale factor changes so chunks are not flushed and glyphes with different scale factor can be merged.
I handled this in using the rotation angle from document: it's ok now.
I'm not sure to know if it's worth or better.
I fixed the big space things but some shift are due to less spans. |
/botio test |
From: Bot.io (Linux m4)ReceivedCommand cmd_test from @calixteman received. Current queue size: 0 Live output at: http://54.241.84.105:8877/94d0bf5ff830e90/output.txt |
From: Bot.io (Windows)ReceivedCommand cmd_test from @calixteman received. Current queue size: 0 Live output at: http://54.193.163.58:8877/74a22de94fb2026/output.txt |
From: Bot.io (Linux m4)FailedFull output at http://54.241.84.105:8877/94d0bf5ff830e90/output.txt Total script time: 22.36 mins
Image differences available at: http://54.241.84.105:8877/94d0bf5ff830e90/reftest-analyzer.html#web=eq.log |
From: Bot.io (Windows)FailedFull output at http://54.193.163.58:8877/74a22de94fb2026/output.txt Total script time: 41.21 mins
Image differences available at: http://54.193.163.58:8877/74a22de94fb2026/reftest-analyzer.html#web=eq.log |
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.
Looking at the test results, I do believe that there's too much movement (and some outright regressions) in existing test-cases. The following is a non-exhaustive list (focusing on Firefox), so please go through the test results and see what can be done to improve (some of) these cases:
- tracemonkey-text-page1, one case of worse agreement between the canvas/textLayer.
- issue3925-page1, many cases of disagreement between the canvas/textLayer.
- taro-text-page1..4, worse agreement between the canvas/textLayer for the vertical text.
- issue11713-page1, the sizing looks off for the last glyph.
- issue1127-text-page1, there's both improvements and regressions,
- issue4684-text-page1, lots of separate spaces being inserted.
- issue5896-text-page1, another possible issue with space handling (based on the reference images).
- mao-text-page1, slightly worse agreement between the canvas/textLayer in places.
- issue6605-page1, all spaces seem to be missing in the textLayer (causing bad alignment).
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'm honestly not really sure what to make of the test results, since regardless of the MAX_FACTOR
value there's going to be some regressions.
/cc @brendandahl What's your opinion here, what sort of movement (in existing test-cases) are we willing to trade for a handful of fixed issues?
Calixte mentioned .5 seemed to be the best compromise, so I looked through those ones. As mentioned above there are few regressions but there also some improvements (issue6019-text-page1, taro-text-page1). IIRC the PDF in One I'm a bit concerned about is If we can fix mao, I'd be fine with taking a few minor regressions for all the copy/paste bugs this fixes. |
- PR mozilla#13257 fixed a lot of issues but not all and this patch aims to fix almost all remaining issues. - the idea in this new patch is to compare position of new glyph with the last position where a glyph has been drawn; - no space are "drawn": it just moves the cursor but they aren't added in the chunk; - so this way a space followed by a cursor move can be treated as only one space: it helps to merge all spaces into one. - to make difference between real spaces and tracking ones, we used a factor of the space width (from the font) - it was a pretty good idea in general but it fails with some fonts where space was too big: - in Poppler, they're using a factor of the font size: this is an excellent idea (<= 0.1 * fontSize implies tracking space).
I set the MAX_FACTOR to 0.6 and fixed few issues in mao test. |
From: Bot.io (Linux m4)ReceivedCommand cmd_test from @calixteman received. Current queue size: 0 Live output at: http://54.241.84.105:8877/6b6d60f532e2ded/output.txt |
From: Bot.io (Windows)ReceivedCommand cmd_test from @calixteman received. Current queue size: 0 Live output at: http://54.193.163.58:8877/d0283e3b1279d8d/output.txt |
From: Bot.io (Linux m4)FailedFull output at http://54.241.84.105:8877/6b6d60f532e2ded/output.txt Total script time: 20.51 mins
Image differences available at: http://54.241.84.105:8877/6b6d60f532e2ded/reftest-analyzer.html#web=eq.log |
/botio-linux test |
From: Bot.io (Linux m4)ReceivedCommand cmd_test from @calixteman received. Current queue size: 0 Live output at: http://54.241.84.105:8877/fb791b216583a90/output.txt |
From: Bot.io (Windows)FailedFull output at http://54.193.163.58:8877/d0283e3b1279d8d/output.txt Total script time: 40.88 mins
Image differences available at: http://54.193.163.58:8877/d0283e3b1279d8d/reftest-analyzer.html#web=eq.log |
From: Bot.io (Linux m4)FailedFull output at http://54.241.84.105:8877/fb791b216583a90/output.txt Total script time: 22.53 mins
Image differences available at: http://54.241.84.105:8877/fb791b216583a90/reftest-analyzer.html#web=eq.log |
/botio-linux preview |
From: Bot.io (Linux m4)ReceivedCommand cmd_preview from @Snuffleupagus received. Current queue size: 0 Live output at: http://54.241.84.105:8877/2c304410c0dd850/output.txt |
From: Bot.io (Linux m4)SuccessFull output at http://54.241.84.105:8877/2c304410c0dd850/output.txt Total script time: 4.44 mins Published |
/botio makeref |
From: Bot.io (Linux m4)ReceivedCommand cmd_makeref from @calixteman received. Current queue size: 0 Live output at: http://54.241.84.105:8877/1e5d6828893ccdb/output.txt |
From: Bot.io (Windows)ReceivedCommand cmd_makeref from @calixteman received. Current queue size: 1 Live output at: http://54.193.163.58:8877/024a1819bef3382/output.txt |
From: Bot.io (Linux m4)SuccessFull output at http://54.241.84.105:8877/1e5d6828893ccdb/output.txt Total script time: 20.36 mins
|
From: Bot.io (Windows)SuccessFull output at http://54.193.163.58:8877/024a1819bef3382/output.txt Total script time: 38.20 mins
|
Fixes #6705
Fixes #7833
Fixes #9247
Fixes #9998
Fixes #10448
Fixes #10640
Fixes #10900
Fixes #11913
Fixes #13201
Fixes #13226