Fix text spacing with vertical fonts. #7687 and #11526.

When the writing mode is vertical, we have to reverse
the sign of spacing since we are subtracting it from
current.y. We have to add it to current.y.
See 9.4.4 Text Space Details, https://www.adobe.com/content/dam/acom/en/devnet/acrobat/pdfs/PDF32000_2008.pdf#G8.1694762
This commit is contained in:
Takashi Tamura 2020-01-27 11:03:27 +09:00
parent 10be0997a7
commit 512dbe3060
3 changed files with 15 additions and 1 deletions

View File

@ -1719,7 +1719,12 @@ var CanvasGraphics = (function CanvasGraphicsClosure() {
}
}
var charWidth = width * widthAdvanceScale + spacing * fontDirection;
var charWidth;
if (vertical) {
charWidth = width * widthAdvanceScale - spacing * fontDirection;
} else {
charWidth = width * widthAdvanceScale + spacing * fontDirection;
}
x += charWidth;
if (restoreNeeded) {

View File

@ -0,0 +1 @@
https://web.archive.org/web/20200210200830/https://www.nta.go.jp/taxes/tetsuzuki/shinsei/shinkoku/zoyo/yoshiki2019/pdf/006.pdf

View File

@ -4376,5 +4376,13 @@
"rounds": 1,
"link": false,
"type": "eq"
},
{ "id": "issue11526",
"file": "pdfs/issue11526.pdf",
"md5": "9babc771fc8792f43e4ada46b0daff8c",
"rounds": 1,
"lastPage": 1,
"link": true,
"type": "eq"
}
]