1
0
Fork 0
mirror of https://github.com/mozilla/pdf.js.git synced 2025-04-20 23:28:06 +02:00

Implement textRise; reduce ref test to one page

This commit is contained in:
Yury Delendik 2012-08-01 15:10:48 -05:00
parent 12bc84fd24
commit 41a4272463
2 changed files with 4 additions and 3 deletions

View file

@ -157,6 +157,7 @@ var CanvasExtraState = (function CanvasExtraStateClosure() {
this.wordSpacing = 0;
this.textHScale = 1;
this.textRenderingMode = TextRenderingMode.FILL;
this.textRise = 0;
// Color spaces
this.fillColorSpace = new DeviceGrayCS();
this.fillColorSpaceObj = null;
@ -601,7 +602,7 @@ var CanvasGraphics = (function CanvasGraphicsClosure() {
this.current.textRenderingMode = mode;
},
setTextRise: function CanvasGraphics_setTextRise(rise) {
TODO('text rise: ' + rise);
this.current.textRise = rise;
},
moveText: function CanvasGraphics_moveText(x, y) {
this.current.x = this.current.lineX += x;
@ -628,7 +629,7 @@ var CanvasGraphics = (function CanvasGraphicsClosure() {
ctx.transform.apply(ctx, current.textMatrix);
ctx.scale(1, -1);
ctx.translate(current.x, -1 * current.y);
ctx.translate(current.x, -current.y - current.textRise);
ctx.transform.apply(ctx, fontMatrix);
ctx.scale(textHScale, 1);
},