mirror of
https://github.com/zen-browser/pdf.js.git
synced 2025-07-08 17:30:09 +02:00
Merge pull request #5193 from nnethercote/data-font-name
Only use data-font-name attributes when necessary.
This commit is contained in:
commit
4ef70588de
1 changed files with 6 additions and 1 deletions
|
@ -156,7 +156,12 @@ var TextLayerBuilder = (function TextLayerBuilderClosure() {
|
||||||
textDiv.style.fontFamily = style.fontFamily;
|
textDiv.style.fontFamily = style.fontFamily;
|
||||||
|
|
||||||
textDiv.textContent = geom.str;
|
textDiv.textContent = geom.str;
|
||||||
|
// |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;
|
textDiv.dataset.fontName = geom.fontName;
|
||||||
|
}
|
||||||
// Storing into dataset will convert number into string.
|
// Storing into dataset will convert number into string.
|
||||||
if (angle !== 0) {
|
if (angle !== 0) {
|
||||||
textDiv.dataset.angle = angle * (180 / Math.PI);
|
textDiv.dataset.angle = angle * (180 / Math.PI);
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue