Browse Source

PDF.js version 1.0.867

master v1.0.867
Pdf Bot 10 years ago
parent
commit
dbe8ea1ec1
  1. 2
      bower.json
  2. 77
      build/pdf.combined.js
  3. 77
      build/pdf.js
  4. 4
      build/pdf.worker.js
  5. 2
      package.json

2
bower.json

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

77
build/pdf.combined.js

@ -22,8 +22,8 @@ if (typeof PDFJS === 'undefined') {
(typeof window !== 'undefined' ? window : this).PDFJS = {}; (typeof window !== 'undefined' ? window : this).PDFJS = {};
} }
PDFJS.version = '1.0.864'; PDFJS.version = '1.0.867';
PDFJS.build = '88d5fa0'; PDFJS.build = '1858fbf';
(function pdfjsWrapper() { (function pdfjsWrapper() {
// Use strict in our context only - users might not want it // Use strict in our context only - users might not want it
@ -2496,7 +2496,7 @@ var WorkerTransport = (function WorkerTransportClosure() {
this.commonObjs.resolve(id, error); this.commonObjs.resolve(id, error);
break; break;
} else { } else {
font = new FontFace(exportedData); font = new FontFaceObject(exportedData);
} }
FontLoader.bind( FontLoader.bind(
@ -6001,6 +6001,10 @@ var FontLoader = {
if (styleElement) { if (styleElement) {
styleElement.parentNode.removeChild(styleElement); styleElement.parentNode.removeChild(styleElement);
} }
this.nativeFontFaces.forEach(function(nativeFontFace) {
document.fonts.delete(nativeFontFace);
});
this.nativeFontFaces.length = 0;
}, },
get loadTestFont() { get loadTestFont() {
// This is a CFF font with 1 glyph for '.' that fills its entire width and // This is a CFF font with 1 glyph for '.' that fills its entire width and
@ -6057,10 +6061,21 @@ var FontLoader = {
return false; return false;
})(), })(),
nativeFontFaces: [],
isFontLoadingAPISupported: !isWorker && !!document.fonts,
addNativeFontFace: function fontLoader_addNativeFontFace(nativeFontFace) {
this.nativeFontFaces.push(nativeFontFace);
document.fonts.add(nativeFontFace);
},
bind: function fontLoaderBind(fonts, callback) { bind: function fontLoaderBind(fonts, callback) {
assert(!isWorker, 'bind() shall be called from main thread'); assert(!isWorker, 'bind() shall be called from main thread');
var rules = [], fontsToLoad = []; var rules = [];
var fontsToLoad = [];
var fontLoadPromises = [];
for (var i = 0, ii = fonts.length; i < ii; i++) { for (var i = 0, ii = fonts.length; i < ii; i++) {
var font = fonts[i]; var font = fonts[i];
@ -6071,15 +6086,26 @@ var FontLoader = {
} }
font.attached = true; font.attached = true;
var rule = font.bindDOM(); if (this.isFontLoadingAPISupported) {
if (rule) { var nativeFontFace = font.createNativeFontFace();
rules.push(rule); if (nativeFontFace) {
fontsToLoad.push(font); fontLoadPromises.push(nativeFontFace.loaded);
}
} else {
var rule = font.bindDOM();
if (rule) {
rules.push(rule);
fontsToLoad.push(font);
}
} }
} }
var request = FontLoader.queueLoadingCallback(callback); var request = FontLoader.queueLoadingCallback(callback);
if (rules.length > 0 && !this.isSyncFontLoadingSupported) { if (this.isFontLoadingAPISupported) {
Promise.all(fontsToLoad).then(function() {
request.complete();
});
} else if (rules.length > 0 && !this.isSyncFontLoadingSupported) {
FontLoader.prepareFontLoadEvent(rules, fontsToLoad, request); FontLoader.prepareFontLoadEvent(rules, fontsToLoad, request);
} else { } else {
request.complete(); request.complete();
@ -6214,8 +6240,8 @@ var FontLoader = {
} }
}; };
var FontFace = (function FontFaceClosure() { var FontFaceObject = (function FontFaceObjectClosure() {
function FontFace(name, file, properties) { function FontFaceObject(name, file, properties) {
this.compiledGlyphs = {}; this.compiledGlyphs = {};
if (arguments.length === 1) { if (arguments.length === 1) {
// importing translated data // importing translated data
@ -6226,8 +6252,29 @@ var FontFace = (function FontFaceClosure() {
return; return;
} }
} }
FontFace.prototype = { FontFaceObject.prototype = {
bindDOM: function FontFace_bindDOM() { createNativeFontFace: function FontFaceObject_createNativeFontFace() {
if (!this.data) {
return null;
}
if (PDFJS.disableFontFace) {
this.disableFontFace = true;
return null;
}
var nativeFontFace = new FontFace(this.loadedName, this.data);
FontLoader.addNativeFontFace(nativeFontFace);
if (PDFJS.pdfBug && 'FontInspector' in globalScope &&
globalScope['FontInspector'].enabled) {
globalScope['FontInspector'].fontAdded(this);
}
return nativeFontFace;
},
bindDOM: function FontFaceObject_bindDOM() {
if (!this.data) { if (!this.data) {
return null; return null;
} }
@ -6254,7 +6301,7 @@ var FontFace = (function FontFaceClosure() {
return rule; return rule;
}, },
getPathGenerator: function (objs, character) { getPathGenerator: function FontLoader_getPathGenerator(objs, character) {
if (!(character in this.compiledGlyphs)) { if (!(character in this.compiledGlyphs)) {
var js = objs.get(this.loadedName + '_path_' + character); var js = objs.get(this.loadedName + '_path_' + character);
/*jshint -W054 */ /*jshint -W054 */
@ -6263,7 +6310,7 @@ var FontFace = (function FontFaceClosure() {
return this.compiledGlyphs[character]; return this.compiledGlyphs[character];
} }
}; };
return FontFace; return FontFaceObject;
})(); })();

77
build/pdf.js

@ -22,8 +22,8 @@ if (typeof PDFJS === 'undefined') {
(typeof window !== 'undefined' ? window : this).PDFJS = {}; (typeof window !== 'undefined' ? window : this).PDFJS = {};
} }
PDFJS.version = '1.0.864'; PDFJS.version = '1.0.867';
PDFJS.build = '88d5fa0'; PDFJS.build = '1858fbf';
(function pdfjsWrapper() { (function pdfjsWrapper() {
// Use strict in our context only - users might not want it // Use strict in our context only - users might not want it
@ -2540,7 +2540,7 @@ var WorkerTransport = (function WorkerTransportClosure() {
this.commonObjs.resolve(id, error); this.commonObjs.resolve(id, error);
break; break;
} else { } else {
font = new FontFace(exportedData); font = new FontFaceObject(exportedData);
} }
FontLoader.bind( FontLoader.bind(
@ -6045,6 +6045,10 @@ var FontLoader = {
if (styleElement) { if (styleElement) {
styleElement.parentNode.removeChild(styleElement); styleElement.parentNode.removeChild(styleElement);
} }
this.nativeFontFaces.forEach(function(nativeFontFace) {
document.fonts.delete(nativeFontFace);
});
this.nativeFontFaces.length = 0;
}, },
get loadTestFont() { get loadTestFont() {
// This is a CFF font with 1 glyph for '.' that fills its entire width and // This is a CFF font with 1 glyph for '.' that fills its entire width and
@ -6101,10 +6105,21 @@ var FontLoader = {
return false; return false;
})(), })(),
nativeFontFaces: [],
isFontLoadingAPISupported: !isWorker && !!document.fonts,
addNativeFontFace: function fontLoader_addNativeFontFace(nativeFontFace) {
this.nativeFontFaces.push(nativeFontFace);
document.fonts.add(nativeFontFace);
},
bind: function fontLoaderBind(fonts, callback) { bind: function fontLoaderBind(fonts, callback) {
assert(!isWorker, 'bind() shall be called from main thread'); assert(!isWorker, 'bind() shall be called from main thread');
var rules = [], fontsToLoad = []; var rules = [];
var fontsToLoad = [];
var fontLoadPromises = [];
for (var i = 0, ii = fonts.length; i < ii; i++) { for (var i = 0, ii = fonts.length; i < ii; i++) {
var font = fonts[i]; var font = fonts[i];
@ -6115,15 +6130,26 @@ var FontLoader = {
} }
font.attached = true; font.attached = true;
var rule = font.bindDOM(); if (this.isFontLoadingAPISupported) {
if (rule) { var nativeFontFace = font.createNativeFontFace();
rules.push(rule); if (nativeFontFace) {
fontsToLoad.push(font); fontLoadPromises.push(nativeFontFace.loaded);
}
} else {
var rule = font.bindDOM();
if (rule) {
rules.push(rule);
fontsToLoad.push(font);
}
} }
} }
var request = FontLoader.queueLoadingCallback(callback); var request = FontLoader.queueLoadingCallback(callback);
if (rules.length > 0 && !this.isSyncFontLoadingSupported) { if (this.isFontLoadingAPISupported) {
Promise.all(fontsToLoad).then(function() {
request.complete();
});
} else if (rules.length > 0 && !this.isSyncFontLoadingSupported) {
FontLoader.prepareFontLoadEvent(rules, fontsToLoad, request); FontLoader.prepareFontLoadEvent(rules, fontsToLoad, request);
} else { } else {
request.complete(); request.complete();
@ -6258,8 +6284,8 @@ var FontLoader = {
} }
}; };
var FontFace = (function FontFaceClosure() { var FontFaceObject = (function FontFaceObjectClosure() {
function FontFace(name, file, properties) { function FontFaceObject(name, file, properties) {
this.compiledGlyphs = {}; this.compiledGlyphs = {};
if (arguments.length === 1) { if (arguments.length === 1) {
// importing translated data // importing translated data
@ -6270,8 +6296,29 @@ var FontFace = (function FontFaceClosure() {
return; return;
} }
} }
FontFace.prototype = { FontFaceObject.prototype = {
bindDOM: function FontFace_bindDOM() { createNativeFontFace: function FontFaceObject_createNativeFontFace() {
if (!this.data) {
return null;
}
if (PDFJS.disableFontFace) {
this.disableFontFace = true;
return null;
}
var nativeFontFace = new FontFace(this.loadedName, this.data);
FontLoader.addNativeFontFace(nativeFontFace);
if (PDFJS.pdfBug && 'FontInspector' in globalScope &&
globalScope['FontInspector'].enabled) {
globalScope['FontInspector'].fontAdded(this);
}
return nativeFontFace;
},
bindDOM: function FontFaceObject_bindDOM() {
if (!this.data) { if (!this.data) {
return null; return null;
} }
@ -6298,7 +6345,7 @@ var FontFace = (function FontFaceClosure() {
return rule; return rule;
}, },
getPathGenerator: function (objs, character) { getPathGenerator: function FontLoader_getPathGenerator(objs, character) {
if (!(character in this.compiledGlyphs)) { if (!(character in this.compiledGlyphs)) {
var js = objs.get(this.loadedName + '_path_' + character); var js = objs.get(this.loadedName + '_path_' + character);
/*jshint -W054 */ /*jshint -W054 */
@ -6307,7 +6354,7 @@ var FontFace = (function FontFaceClosure() {
return this.compiledGlyphs[character]; return this.compiledGlyphs[character];
} }
}; };
return FontFace; return FontFaceObject;
})(); })();

4
build/pdf.worker.js vendored

@ -22,8 +22,8 @@ if (typeof PDFJS === 'undefined') {
(typeof window !== 'undefined' ? window : this).PDFJS = {}; (typeof window !== 'undefined' ? window : this).PDFJS = {};
} }
PDFJS.version = '1.0.864'; PDFJS.version = '1.0.867';
PDFJS.build = '88d5fa0'; PDFJS.build = '1858fbf';
(function pdfjsWrapper() { (function pdfjsWrapper() {
// Use strict in our context only - users might not want it // Use strict in our context only - users might not want it

2
package.json

@ -1,6 +1,6 @@
{ {
"name": "pdfjs-dist", "name": "pdfjs-dist",
"version": "1.0.864", "version": "1.0.867",
"description": "Generic build of Mozilla's PDF.js library.", "description": "Generic build of Mozilla's PDF.js library.",
"keywords": [ "keywords": [
"Mozilla", "Mozilla",

Loading…
Cancel
Save