-
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
[api-minor] Add basic support for RTL text-content in PopupAnnotations (issue 14046) #14074
Conversation
f719589
to
3050067
Compare
…s (issue 14046) In order to implement this, we utilize the existing `bidi` function to infer the text-direction of /T and /Contents entries. While this may not be perfect in cases where one PopupAnnotation mixes LTR and RTL languages, it should work well enough in most cases. To avoid having to add *two new* properties in lots of annotations, supplementing the existing `title`/`contents`-properties, this patch instead re-factors the existing code such that the properties are replaced by Objects (containing `str` and `dir`). *Please note:* In order avoid breaking existing third-party implementations, `GENERIC`-builds of the PDF.js library will still provide the old `title`/`contents`-properties on annotations returned by `PDFPageProxy.getAnnotations`.
3050067
to
1dcd2f0
Compare
From: Bot.io (Linux m4)ReceivedCommand cmd_preview from @Snuffleupagus received. Current queue size: 0 Live output at: http://54.241.84.105:8877/44a3bf3b43d5d1c/output.txt |
From: Bot.io (Linux m4)SuccessFull output at http://54.241.84.105:8877/44a3bf3b43d5d1c/output.txt Total script time: 4.33 mins Published |
/botio test |
From: Bot.io (Linux m4)ReceivedCommand cmd_test from @Snuffleupagus received. Current queue size: 0 Live output at: http://54.241.84.105:8877/016e49f06b75625/output.txt |
From: Bot.io (Windows)ReceivedCommand cmd_test from @Snuffleupagus received. Current queue size: 0 Live output at: http://54.193.163.58:8877/98784daa6f0dcc7/output.txt |
From: Bot.io (Linux m4)FailedFull output at http://54.241.84.105:8877/016e49f06b75625/output.txt Total script time: 21.90 mins
Image differences available at: http://54.241.84.105:8877/016e49f06b75625/reftest-analyzer.html#web=eq.log |
From: Bot.io (Windows)FailedFull output at http://54.193.163.58:8877/98784daa6f0dcc7/output.txt Total script time: 40.15 mins
Image differences available at: http://54.193.163.58:8877/98784daa6f0dcc7/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.
LGTM and thank you for doing this.
In order to implement this, we utilize the existing
bidi
function to infer the text-direction of /T and /Contents entries. While this may not be perfect in cases where one PopupAnnotation mixes LTR and RTL languages, it should work well enough in most cases.To avoid having to add two new properties in lots of annotations, supplementing the existing
title
/contents
-properties, this patch instead re-factors the existing code such that the properties are replaced by Objects (containingstr
anddir
).Please note: In order avoid breaking existing third-party implementations,
GENERIC
-builds of the PDF.js library will still provide the oldtitle
/contents
-properties on annotations returned byPDFPageProxy.getAnnotations
.Fixes #14046