Fixes Type3 negative font direction

This commit is contained in:
Yury Delendik 2014-08-18 17:57:52 -05:00
parent 4ef70588de
commit be998261cc
4 changed files with 11 additions and 2 deletions

View File

@ -1473,7 +1473,7 @@ var CanvasGraphics = (function CanvasGraphicsClosure() {
ctx.transform.apply(ctx, current.textMatrix); ctx.transform.apply(ctx, current.textMatrix);
ctx.translate(current.x, current.y); ctx.translate(current.x, current.y);
ctx.scale(textHScale, 1); ctx.scale(textHScale, fontDirection);
for (i = 0; i < glyphsLength; ++i) { for (i = 0; i < glyphsLength; ++i) {
glyph = glyphs[i]; glyph = glyphs[i];
@ -1503,7 +1503,7 @@ var CanvasGraphics = (function CanvasGraphicsClosure() {
this.restore(); this.restore();
var transformed = Util.applyTransform([glyph.width, 0], fontMatrix); var transformed = Util.applyTransform([glyph.width, 0], fontMatrix);
width = ((transformed[0] * fontSize + charSpacing) * fontDirection); width = transformed[0] * fontSize + charSpacing;
ctx.translate(width, 0); ctx.translate(width, 0);
current.x += width * textHScale; current.x += width * textHScale;

View File

@ -38,6 +38,7 @@
!issue3323.pdf !issue3323.pdf
!issue4304.pdf !issue4304.pdf
!issue4550.pdf !issue4550.pdf
!bug1011159.pdf
!issue4875.pdf !issue4875.pdf
!issue4881.pdf !issue4881.pdf
!rotated.pdf !rotated.pdf

BIN
test/pdfs/bug1011159.pdf Normal file

Binary file not shown.

View File

@ -1441,6 +1441,14 @@
"link": true, "link": true,
"type": "eq" "type": "eq"
}, },
{ "id": "bug1011159",
"file": "pdfs/bug1011159.pdf",
"md5": "4532e22deb92d4cd2992d0cfe255582a",
"rounds": 1,
"lastPage": 1,
"type": "eq",
"about": "Type3 font with negative HScale and font size"
},
{ "id": "bug816075", { "id": "bug816075",
"file": "pdfs/bug816075.pdf", "file": "pdfs/bug816075.pdf",
"md5": "7ec87c115c1f9ec41234cc7002555e82", "md5": "7ec87c115c1f9ec41234cc7002555e82",