diff --git a/bower.json b/bower.json index 8d1094a53..42984d294 100644 --- a/bower.json +++ b/bower.json @@ -1,6 +1,6 @@ { "name": "pdfjs-dist", - "version": "1.3.66", + "version": "1.3.68", "main": [ "build/pdf.js", "build/pdf.worker.js" diff --git a/build/pdf.combined.js b/build/pdf.combined.js index 51187cdbe..8584e1d7c 100644 --- a/build/pdf.combined.js +++ b/build/pdf.combined.js @@ -20,8 +20,8 @@ if (typeof PDFJS === 'undefined') { (typeof window !== 'undefined' ? window : this).PDFJS = {}; } -PDFJS.version = '1.3.66'; -PDFJS.build = '7b144c0'; +PDFJS.version = '1.3.68'; +PDFJS.build = '91b27aa'; (function pdfjsWrapper() { // Use strict in our context only - users might not want it @@ -5106,16 +5106,22 @@ var CanvasGraphics = (function CanvasGraphicsClosure() { scaledY = 0; } - if (font.remeasure && width > 0 && this.isFontSubpixelAAEnabled) { - // some standard fonts may not have the exact width, trying to - // rescale per character + if (font.remeasure && width > 0) { + // Some standard fonts may not have the exact width: rescale per + // character if measured width is greater than expected glyph width + // and subpixel-aa is enabled, otherwise just center the glyph. var measuredWidth = ctx.measureText(character).width * 1000 / fontSize * fontSizeScale; - var characterScaleX = width / measuredWidth; - restoreNeeded = true; - ctx.save(); - ctx.scale(characterScaleX, 1); - scaledX /= characterScaleX; + if (width < measuredWidth && this.isFontSubpixelAAEnabled) { + var characterScaleX = width / measuredWidth; + restoreNeeded = true; + ctx.save(); + ctx.scale(characterScaleX, 1); + scaledX /= characterScaleX; + } else if (width !== measuredWidth) { + scaledX += (width - measuredWidth) / 2000 * + fontSize / fontSizeScale; + } } if (simpleFillText && !accent) { diff --git a/build/pdf.js b/build/pdf.js index 2a05fcd65..281543128 100644 --- a/build/pdf.js +++ b/build/pdf.js @@ -20,8 +20,8 @@ if (typeof PDFJS === 'undefined') { (typeof window !== 'undefined' ? window : this).PDFJS = {}; } -PDFJS.version = '1.3.66'; -PDFJS.build = '7b144c0'; +PDFJS.version = '1.3.68'; +PDFJS.build = '91b27aa'; (function pdfjsWrapper() { // Use strict in our context only - users might not want it @@ -5165,16 +5165,22 @@ var CanvasGraphics = (function CanvasGraphicsClosure() { scaledY = 0; } - if (font.remeasure && width > 0 && this.isFontSubpixelAAEnabled) { - // some standard fonts may not have the exact width, trying to - // rescale per character + if (font.remeasure && width > 0) { + // Some standard fonts may not have the exact width: rescale per + // character if measured width is greater than expected glyph width + // and subpixel-aa is enabled, otherwise just center the glyph. var measuredWidth = ctx.measureText(character).width * 1000 / fontSize * fontSizeScale; - var characterScaleX = width / measuredWidth; - restoreNeeded = true; - ctx.save(); - ctx.scale(characterScaleX, 1); - scaledX /= characterScaleX; + if (width < measuredWidth && this.isFontSubpixelAAEnabled) { + var characterScaleX = width / measuredWidth; + restoreNeeded = true; + ctx.save(); + ctx.scale(characterScaleX, 1); + scaledX /= characterScaleX; + } else if (width !== measuredWidth) { + scaledX += (width - measuredWidth) / 2000 * + fontSize / fontSizeScale; + } } if (simpleFillText && !accent) { diff --git a/build/pdf.worker.js b/build/pdf.worker.js index 9359d734b..e1d2a8825 100644 --- a/build/pdf.worker.js +++ b/build/pdf.worker.js @@ -20,8 +20,8 @@ if (typeof PDFJS === 'undefined') { (typeof window !== 'undefined' ? window : this).PDFJS = {}; } -PDFJS.version = '1.3.66'; -PDFJS.build = '7b144c0'; +PDFJS.version = '1.3.68'; +PDFJS.build = '91b27aa'; (function pdfjsWrapper() { // Use strict in our context only - users might not want it diff --git a/package.json b/package.json index 3666d5826..2d8b0cdbc 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "pdfjs-dist", - "version": "1.3.66", + "version": "1.3.68", "description": "Generic build of Mozilla's PDF.js library.", "keywords": [ "Mozilla",