-
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
Implement text rise for the SVG back-end #8796
Conversation
/botio-linux preview |
/botio test |
@Rob--W Since you're also working on the SVG-backend, would you perhaps have time to review this? /botio-windows test |
src/display/svg.js
Outdated
// original text matrix. | ||
let matrix = current.textMatrix.slice(); | ||
if (current.textRise !== 0) { | ||
matrix[5] += current.textRise; |
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.
How often is this called? If setTextRise
is called quite often, then you could relieve the GC by only making a copy when it is needed:
let matrix = current.textMatrix;
if (current.textRise) {
matrix = matrix.slice();
matrix[5] += current.textRise;
}
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.
Good point! Fixed in the new commit.
The property and the setter for text rise were already present, but they were never used or called. This patch completes the implementation by calling the setter when the operator is encountered and by using the text rise value when rendering text.
c2b4360
to
cfc052a
Compare
Why is the unit test in Chrome failing on Windows?
|
This is a known intermittent after the stream API changes landed, but somehow I forgot to file it before. I just did that in #8816. It's not related to this patch. |
/botio-linux preview |
The intermittent unit test failure is fixed, so it should be fine now. |
/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/9d7e28f30c4e4ba/output.txt |
From: Bot.io (Linux m4)SuccessFull output at http://54.67.70.0:8877/9d7e28f30c4e4ba/output.txt Total script time: 2.37 mins Published |
/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/0ae1cf678c21930/output.txt |
From: Bot.io (Windows)ReceivedCommand cmd_test from @timvandermeij received. Current queue size: 1 Live output at: http://54.215.176.217:8877/a4f2d999e512641/output.txt |
From: Bot.io (Linux m4)SuccessFull output at http://54.67.70.0:8877/0ae1cf678c21930/output.txt Total script time: 16.45 mins
|
From: Bot.io (Windows)FailedFull output at http://54.215.176.217:8877/a4f2d999e512641/output.txt Total script time: 29.58 mins
Image differences available at: http://54.215.176.217:8877/a4f2d999e512641/reftest-analyzer.html#web=eq.log |
Thanks for the patch. I wish that we also had reftesting for the SVG backend. |
Implement text rise for the SVG back-end
The property and the setter for text rise were already present, but they were never used or called. This patch completes the implementation by calling the setter when the operator is encountered and by using the text rise value when rendering text.
To verify the current behavior:
PDFViewerApplication.preferences.set('renderer', 'svg');
in the console and refresh.1
and2
in the footnotes are not in superscript and that the console contains a message about the unimplemented operatorsetTextRise
.To verify the new behavior:
PDFViewerApplication.preferences.set('renderer', 'svg');
in the console and refresh.footnotes_in_text.pdf
fule using the Open File button in the viewer. Notice that the1
and2
in the footnotes are in superscript and that the console message is gone.