Browse Source

PDF.js version 1.4.113 - See mozilla/pdf.js@a6acf74b54484c59df11e874ce552775f19dfcf3

master v1.4.113
Pdf Bot 9 years ago
parent
commit
a78da5926c
  1. 2
      bower.json
  2. 42
      build/pdf.combined.js
  3. 26
      build/pdf.js
  4. 20
      build/pdf.worker.js
  5. 2
      package.json

2
bower.json

@ -1,6 +1,6 @@
{ {
"name": "pdfjs-dist", "name": "pdfjs-dist",
"version": "1.4.111", "version": "1.4.113",
"main": [ "main": [
"build/pdf.js", "build/pdf.js",
"build/pdf.worker.js" "build/pdf.worker.js"

42
build/pdf.combined.js

@ -28,8 +28,8 @@ factory((root.pdfjsDistBuildPdfCombined = {}));
// Use strict in our context only - users might not want it // Use strict in our context only - users might not want it
'use strict'; 'use strict';
var pdfjsVersion = '1.4.111'; var pdfjsVersion = '1.4.113';
var pdfjsBuild = '6b1de4a'; var pdfjsBuild = 'a6acf74';
var pdfjsFilePath = var pdfjsFilePath =
typeof document !== 'undefined' && document.currentScript ? typeof document !== 'undefined' && document.currentScript ?
@ -29773,15 +29773,19 @@ var CanvasGraphics = (function CanvasGraphicsClosure() {
} }
} }
if (simpleFillText && !accent) { // Only attempt to draw the glyph if it is actually in the embedded font
// common case // file or if there isn't a font file so the fallback font is shown.
ctx.fillText(character, scaledX, scaledY); if (glyph.isInFont || font.missingFile) {
} else { if (simpleFillText && !accent) {
this.paintChar(character, scaledX, scaledY); // common case
if (accent) { ctx.fillText(character, scaledX, scaledY);
scaledAccentX = scaledX + accent.offset.x / fontSizeScale; } else {
scaledAccentY = scaledY - accent.offset.y / fontSizeScale; this.paintChar(character, scaledX, scaledY);
this.paintChar(accent.fontChar, scaledAccentX, scaledAccentY); if (accent) {
scaledAccentX = scaledX + accent.offset.x / fontSizeScale;
scaledAccentY = scaledY - accent.offset.y / fontSizeScale;
this.paintChar(accent.fontChar, scaledAccentX, scaledAccentY);
}
} }
} }
@ -33929,7 +33933,7 @@ function getFontType(type, subtype) {
var Glyph = (function GlyphClosure() { var Glyph = (function GlyphClosure() {
function Glyph(fontChar, unicode, accent, width, vmetric, operatorListId, function Glyph(fontChar, unicode, accent, width, vmetric, operatorListId,
isSpace) { isSpace, isInFont) {
this.fontChar = fontChar; this.fontChar = fontChar;
this.unicode = unicode; this.unicode = unicode;
this.accent = accent; this.accent = accent;
@ -33937,17 +33941,20 @@ var Glyph = (function GlyphClosure() {
this.vmetric = vmetric; this.vmetric = vmetric;
this.operatorListId = operatorListId; this.operatorListId = operatorListId;
this.isSpace = isSpace; this.isSpace = isSpace;
this.isInFont = isInFont;
} }
Glyph.prototype.matchesForCache = function(fontChar, unicode, accent, width, Glyph.prototype.matchesForCache = function(fontChar, unicode, accent, width,
vmetric, operatorListId, isSpace) { vmetric, operatorListId, isSpace,
isInFont) {
return this.fontChar === fontChar && return this.fontChar === fontChar &&
this.unicode === unicode && this.unicode === unicode &&
this.accent === accent && this.accent === accent &&
this.width === width && this.width === width &&
this.vmetric === vmetric && this.vmetric === vmetric &&
this.operatorListId === operatorListId && this.operatorListId === operatorListId &&
this.isSpace === isSpace; this.isSpace === isSpace &&
this.isInFont === isInFont;
}; };
return Glyph; return Glyph;
@ -34206,6 +34213,7 @@ var Font = (function FontClosure() {
this.loadedName = properties.loadedName; this.loadedName = properties.loadedName;
this.isType3Font = properties.isType3Font; this.isType3Font = properties.isType3Font;
this.sizes = []; this.sizes = [];
this.missingFile = false;
this.glyphCache = Object.create(null); this.glyphCache = Object.create(null);
@ -36548,6 +36556,7 @@ var Font = (function FontClosure() {
unicode = String.fromCharCode(unicode); unicode = String.fromCharCode(unicode);
} }
var isInFont = charcode in this.toFontChar;
// First try the toFontChar map, if it's not there then try falling // First try the toFontChar map, if it's not there then try falling
// back to the char code. // back to the char code.
fontCharCode = this.toFontChar[charcode] || charcode; fontCharCode = this.toFontChar[charcode] || charcode;
@ -36562,6 +36571,7 @@ var Font = (function FontClosure() {
var accent = null; var accent = null;
if (this.seacMap && this.seacMap[charcode]) { if (this.seacMap && this.seacMap[charcode]) {
isInFont = true;
var seac = this.seacMap[charcode]; var seac = this.seacMap[charcode];
fontCharCode = seac.baseFontCharCode; fontCharCode = seac.baseFontCharCode;
accent = { accent = {
@ -36575,9 +36585,9 @@ var Font = (function FontClosure() {
var glyph = this.glyphCache[charcode]; var glyph = this.glyphCache[charcode];
if (!glyph || if (!glyph ||
!glyph.matchesForCache(fontChar, unicode, accent, width, vmetric, !glyph.matchesForCache(fontChar, unicode, accent, width, vmetric,
operatorListId, isSpace)) { operatorListId, isSpace, isInFont)) {
glyph = new Glyph(fontChar, unicode, accent, width, vmetric, glyph = new Glyph(fontChar, unicode, accent, width, vmetric,
operatorListId, isSpace); operatorListId, isSpace, isInFont);
this.glyphCache[charcode] = glyph; this.glyphCache[charcode] = glyph;
} }
return glyph; return glyph;

26
build/pdf.js

@ -28,8 +28,8 @@ factory((root.pdfjsDistBuildPdf = {}));
// Use strict in our context only - users might not want it // Use strict in our context only - users might not want it
'use strict'; 'use strict';
var pdfjsVersion = '1.4.111'; var pdfjsVersion = '1.4.113';
var pdfjsBuild = '6b1de4a'; var pdfjsBuild = 'a6acf74';
var pdfjsFilePath = var pdfjsFilePath =
typeof document !== 'undefined' && document.currentScript ? typeof document !== 'undefined' && document.currentScript ?
@ -7707,15 +7707,19 @@ var CanvasGraphics = (function CanvasGraphicsClosure() {
} }
} }
if (simpleFillText && !accent) { // Only attempt to draw the glyph if it is actually in the embedded font
// common case // file or if there isn't a font file so the fallback font is shown.
ctx.fillText(character, scaledX, scaledY); if (glyph.isInFont || font.missingFile) {
} else { if (simpleFillText && !accent) {
this.paintChar(character, scaledX, scaledY); // common case
if (accent) { ctx.fillText(character, scaledX, scaledY);
scaledAccentX = scaledX + accent.offset.x / fontSizeScale; } else {
scaledAccentY = scaledY - accent.offset.y / fontSizeScale; this.paintChar(character, scaledX, scaledY);
this.paintChar(accent.fontChar, scaledAccentX, scaledAccentY); if (accent) {
scaledAccentX = scaledX + accent.offset.x / fontSizeScale;
scaledAccentY = scaledY - accent.offset.y / fontSizeScale;
this.paintChar(accent.fontChar, scaledAccentX, scaledAccentY);
}
} }
} }

20
build/pdf.worker.js vendored

@ -28,8 +28,8 @@ factory((root.pdfjsDistBuildPdfWorker = {}));
// Use strict in our context only - users might not want it // Use strict in our context only - users might not want it
'use strict'; 'use strict';
var pdfjsVersion = '1.4.111'; var pdfjsVersion = '1.4.113';
var pdfjsBuild = '6b1de4a'; var pdfjsBuild = 'a6acf74';
var pdfjsFilePath = var pdfjsFilePath =
typeof document !== 'undefined' && document.currentScript ? typeof document !== 'undefined' && document.currentScript ?
@ -25953,7 +25953,7 @@ function getFontType(type, subtype) {
var Glyph = (function GlyphClosure() { var Glyph = (function GlyphClosure() {
function Glyph(fontChar, unicode, accent, width, vmetric, operatorListId, function Glyph(fontChar, unicode, accent, width, vmetric, operatorListId,
isSpace) { isSpace, isInFont) {
this.fontChar = fontChar; this.fontChar = fontChar;
this.unicode = unicode; this.unicode = unicode;
this.accent = accent; this.accent = accent;
@ -25961,17 +25961,20 @@ var Glyph = (function GlyphClosure() {
this.vmetric = vmetric; this.vmetric = vmetric;
this.operatorListId = operatorListId; this.operatorListId = operatorListId;
this.isSpace = isSpace; this.isSpace = isSpace;
this.isInFont = isInFont;
} }
Glyph.prototype.matchesForCache = function(fontChar, unicode, accent, width, Glyph.prototype.matchesForCache = function(fontChar, unicode, accent, width,
vmetric, operatorListId, isSpace) { vmetric, operatorListId, isSpace,
isInFont) {
return this.fontChar === fontChar && return this.fontChar === fontChar &&
this.unicode === unicode && this.unicode === unicode &&
this.accent === accent && this.accent === accent &&
this.width === width && this.width === width &&
this.vmetric === vmetric && this.vmetric === vmetric &&
this.operatorListId === operatorListId && this.operatorListId === operatorListId &&
this.isSpace === isSpace; this.isSpace === isSpace &&
this.isInFont === isInFont;
}; };
return Glyph; return Glyph;
@ -26230,6 +26233,7 @@ var Font = (function FontClosure() {
this.loadedName = properties.loadedName; this.loadedName = properties.loadedName;
this.isType3Font = properties.isType3Font; this.isType3Font = properties.isType3Font;
this.sizes = []; this.sizes = [];
this.missingFile = false;
this.glyphCache = Object.create(null); this.glyphCache = Object.create(null);
@ -28572,6 +28576,7 @@ var Font = (function FontClosure() {
unicode = String.fromCharCode(unicode); unicode = String.fromCharCode(unicode);
} }
var isInFont = charcode in this.toFontChar;
// First try the toFontChar map, if it's not there then try falling // First try the toFontChar map, if it's not there then try falling
// back to the char code. // back to the char code.
fontCharCode = this.toFontChar[charcode] || charcode; fontCharCode = this.toFontChar[charcode] || charcode;
@ -28586,6 +28591,7 @@ var Font = (function FontClosure() {
var accent = null; var accent = null;
if (this.seacMap && this.seacMap[charcode]) { if (this.seacMap && this.seacMap[charcode]) {
isInFont = true;
var seac = this.seacMap[charcode]; var seac = this.seacMap[charcode];
fontCharCode = seac.baseFontCharCode; fontCharCode = seac.baseFontCharCode;
accent = { accent = {
@ -28599,9 +28605,9 @@ var Font = (function FontClosure() {
var glyph = this.glyphCache[charcode]; var glyph = this.glyphCache[charcode];
if (!glyph || if (!glyph ||
!glyph.matchesForCache(fontChar, unicode, accent, width, vmetric, !glyph.matchesForCache(fontChar, unicode, accent, width, vmetric,
operatorListId, isSpace)) { operatorListId, isSpace, isInFont)) {
glyph = new Glyph(fontChar, unicode, accent, width, vmetric, glyph = new Glyph(fontChar, unicode, accent, width, vmetric,
operatorListId, isSpace); operatorListId, isSpace, isInFont);
this.glyphCache[charcode] = glyph; this.glyphCache[charcode] = glyph;
} }
return glyph; return glyph;

2
package.json

@ -1,6 +1,6 @@
{ {
"name": "pdfjs-dist", "name": "pdfjs-dist",
"version": "1.4.111", "version": "1.4.113",
"main": "build/pdf.js", "main": "build/pdf.js",
"description": "Generic build of Mozilla's PDF.js library.", "description": "Generic build of Mozilla's PDF.js library.",
"keywords": [ "keywords": [

Loading…
Cancel
Save