1
0
Fork 0
mirror of https://github.com/mozilla/pdf.js.git synced 2025-04-26 01:58:06 +02:00

Do the final text scaling correctly in flushTextContentItem (issue 8276)

It's necessary to take into account whether or not the text is vertical, to avoid either the textContent `width` or `height` becoming incorrect.
This commit is contained in:
Jonas Jenwald 2019-01-29 14:24:48 +01:00
parent 55b12f5fd9
commit 6f94a05a29
4 changed files with 111 additions and 4 deletions

View file

@ -1332,7 +1332,7 @@ var PartialEvaluator = (function PartialEvaluatorClosure() {
fontFamily: font.fallbackName,
ascent: font.ascent,
descent: font.descent,
vertical: font.vertical,
vertical: !!font.vertical,
};
}
textContentItem.fontName = font.loadedName;
@ -1508,9 +1508,12 @@ var PartialEvaluator = (function PartialEvaluatorClosure() {
return;
}
// Do final text scaling
textContentItem.width *= textContentItem.textAdvanceScale;
textContentItem.height *= textContentItem.textAdvanceScale;
// Do final text scaling.
if (!textContentItem.vertical) {
textContentItem.width *= textContentItem.textAdvanceScale;
} else {
textContentItem.height *= textContentItem.textAdvanceScale;
}
textContent.items.push(runBidiTransform(textContentItem));
textContentItem.initialized = false;