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

Detecting if web fonts are disable in Firefox.

This commit is contained in:
Yury Delendik 2012-11-30 16:59:51 -06:00
parent 223ad0c117
commit 5dc87a7fca
4 changed files with 49 additions and 0 deletions

View file

@ -90,6 +90,13 @@ var PDFDocumentProxy = (function PDFDocumentProxyClosure() {
get fingerprint() {
return this.pdfInfo.fingerprint;
},
/**
* @return {boolean} true if embedded document fonts are in use. Will be
* set during rendering of the pages.
*/
get embeddedFontsUsed() {
return this.transport.embeddedFontsUsed;
},
/**
* @param {number} The page number to get. The first page is 1.
* @return {Promise} A promise that is resolved with a {PDFPageProxy}
@ -340,6 +347,9 @@ var PDFPageProxy = (function PDFPageProxyClosure() {
fontObjs.push(obj);
}
this.transport.embeddedFontsUsed = this.transport.embeddedFontsUsed ||
fontObjs.length > 0;
// Load all the fonts
FontLoader.bind(
fontObjs,
@ -443,6 +453,7 @@ var WorkerTransport = (function WorkerTransportClosure() {
this.pageCache = [];
this.pagePromises = [];
this.fontsLoading = {};
this.embeddedFontsUsed = false;
// If worker support isn't disabled explicit and the browser has worker
// support, create a new web worker and test if it/the browser fullfills