1
0
Fork 0
mirror of https://github.com/mozilla/pdf.js.git synced 2025-04-22 16:18:08 +02:00

Fixing the offset of vertical CJK text

This commit is contained in:
Srishti 2013-07-13 01:56:30 +05:30
parent 077f08fa6d
commit 6c3e5e5d92
2 changed files with 5 additions and 15 deletions

View file

@ -1199,11 +1199,8 @@ var CanvasGraphics = (function CanvasGraphicsClosure() {
if (textSelection) {
geom.canvasWidth = canvasWidth;
if (vertical) {
var vmetric = font.defaultVMetrics;
geom.x += vmetric[1] * fontSize * current.fontMatrix[0] /
fontSizeScale * geom.hScale;
geom.y += vmetric[2] * fontSize * current.fontMatrix[0] /
fontSizeScale * geom.vScale;
var VERTICAL_TEXT_ROTATION = Math.PI / 2;
geom.angle += VERTICAL_TEXT_ROTATION;
}
this.textLayer.appendText(geom);
}
@ -1259,12 +1256,8 @@ var CanvasGraphics = (function CanvasGraphicsClosure() {
if (textSelection) {
geom.canvasWidth = canvasWidth;
if (vertical) {
var fontSizeScale = current.fontSizeScale;
var vmetric = font.defaultVMetrics;
geom.x += vmetric[1] * fontSize * current.fontMatrix[0] /
fontSizeScale * geom.hScale;
geom.y += vmetric[2] * fontSize * current.fontMatrix[0] /
fontSizeScale * geom.vScale;
var VERTICAL_TEXT_ROTATION = Math.PI / 2;
geom.angle += VERTICAL_TEXT_ROTATION;
}
this.textLayer.appendText(geom);
}