-
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
Only use data-font-name attributes when necessary. #5193
Conversation
@@ -173,8 +176,11 @@ var TextLayerBuilder = (function TextLayerBuilderClosure() { | |||
this.textContent = textContent; | |||
|
|||
var textItems = textContent.items; | |||
var fontInspectorEnabled = |
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.
Could you add this as the TextLayerBuilder object property to avoid re-evaluating this for each text item
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.
Actually it will be nice to specify that as an option during TextLayerBuilder construction. Can you move this check to the page_view.js level, and save e.g. 'debugFont' option at TextLayerBuilder object property
I think this is what you asked for. |
yes, it is. /botio-linux preview |
From: Bot.io (Linux)ReceivedCommand cmd_preview from @yurydelendik received. Current queue size: 0 Live output at: http://107.21.233.14:8877/254b596744a9a52/output.txt |
From: Bot.io (Linux)SuccessFull output at http://107.21.233.14:8877/254b596744a9a52/output.txt Total script time: 0.75 mins Published
|
@@ -46,6 +46,7 @@ var TextLayerBuilder = (function TextLayerBuilderClosure() { | |||
this.isViewerInPresentationMode = options.isViewerInPresentationMode; | |||
this.textDivs = []; | |||
this.findController = options.findController || null; | |||
this.debugFonts = options.debugFonts; |
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.
Should we have || null
at the end of this line too?
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.
this.debugFonts = !!options.debugFonts;
Built version fails with |
How do failures like this manifest in the testing? E.g. it doesn't show up in the Travis CI test. |
The data-font-name attribute of textLayer divs are only used by the Font Inspector. This change ensures they are only present when the pdfBug tools are enabled.
I ended up removing the |
i think that new test is fine. It like a |
/botio-linux preview |
From: Bot.io (Linux)ReceivedCommand cmd_preview from @yurydelendik received. Current queue size: 0 Live output at: http://107.21.233.14:8877/a22280c910e72d7/output.txt |
From: Bot.io (Linux)SuccessFull output at http://107.21.233.14:8877/a22280c910e72d7/output.txt Total script time: 0.75 mins Published
|
Only use data-font-name attributes when necessary.
Thank you for the patch |
The data-font-name attribute of textLayer divs are only used by the Font
Inspector. This change omits them when Font Inspector is disabled.