Skip to content

Commit

Permalink
Merge pull request mozilla#5193 from nnethercote/data-font-name
Browse files Browse the repository at this point in the history
Only use data-font-name attributes when necessary.
  • Loading branch information
yurydelendik committed Aug 18, 2014
2 parents 6ac995d + eda7dcb commit 4ef7058
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion web/text_layer_builder.js
Original file line number Diff line number Diff line change
Expand Up @@ -156,7 +156,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);
Expand Down

0 comments on commit 4ef7058

Please sign in to comment.