[Pkg-javascript-commits] [pdf.js] 228/246: Only use data-font-name attributes when necessary.

David Prévot taffit at moszumanska.debian.org
Sun Sep 7 15:36:44 UTC 2014


This is an automated email from the git hooks/post-receive script.

taffit pushed a commit to branch master
in repository pdf.js.

commit eda7dcbb9e856aa901a81e44ec4828be30fed3a3
Author: Nicholas Nethercote <nnethercote at mozilla.com>
Date:   Fri Aug 15 07:21:01 2014 -0700

    Only use data-font-name attributes when necessary.
    
    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.
---
 web/text_layer_builder.js | 7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)

diff --git a/web/text_layer_builder.js b/web/text_layer_builder.js
index 03fbcf7..e990a97 100644
--- a/web/text_layer_builder.js
+++ b/web/text_layer_builder.js
@@ -157,7 +157,12 @@ var TextLayerBuilder = (function TextLayerBuilderClosure() {
       textDiv.style.fontFamily = style.fontFamily;
 
       textDiv.textContent = geom.str;
-      textDiv.dataset.fontName = geom.fontName;
+      // |fontName| is only used by the Font Inspector. This test will succeed
+      // when e.g. the Font Inspector is off but the Stepper is on, but it's
+      // not worth the effort to do a more accurate test.
+      if (PDFJS.pdfBug) {
+        textDiv.dataset.fontName = geom.fontName;
+      }
       // Storing into dataset will convert number into string.
       if (angle !== 0) {
         textDiv.dataset.angle = angle * (180 / Math.PI);

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-javascript/pdf.js.git



More information about the Pkg-javascript-commits mailing list