From b0e16ce5c610d33a073c39d76d7982f71add08bc Mon Sep 17 00:00:00 2001 From: Takashi Tamura Date: Fri, 31 Jan 2020 06:55:26 +0900 Subject: [PATCH] Fix the horizontal scaling of texts with SVG backend. #10988 --- src/display/svg.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/display/svg.js b/src/display/svg.js index aa81a28671b047..53d938a1226079 100644 --- a/src/display/svg.js +++ b/src/display/svg.js @@ -823,7 +823,7 @@ if (typeof PDFJSDev === "undefined" || PDFJSDev.test("GENERIC")) { // might actually map to a different glyph. continue; } - current.xcoords.push(current.x + x * textHScale); + current.xcoords.push(current.x + x); current.tspan.textContent += character; x += charWidth; } @@ -892,7 +892,7 @@ if (typeof PDFJSDev === "undefined" || PDFJSDev.test("GENERIC")) { current.txtElement.setAttributeNS( null, "transform", - `${pm(textMatrix)} scale(1, -1)` + `${pm(textMatrix)} scale(${pf(textHScale)}, -1)` ); current.txtElement.setAttributeNS(XML_NS, "xml:space", "preserve"); current.txtElement.appendChild(current.tspan);