Replace the Font.loading
property with, the already existing, Font.missingFile
property
The `Font.loading` property is only ever used *once* in the code, whereas `Font.missingFile` is more widely used. Furthermore the name `loading` feels, at least to me, slight less clear than `missingFile`. Finally, note that these two properties are the inverse of each other.
This commit is contained in:
parent
caf90ff6ee
commit
ad3e937816
@ -589,8 +589,6 @@ var Font = (function FontClosure() {
|
|||||||
this.toUnicode = properties.toUnicode;
|
this.toUnicode = properties.toUnicode;
|
||||||
this.encoding = properties.baseEncoding;
|
this.encoding = properties.baseEncoding;
|
||||||
this.seacMap = properties.seacMap;
|
this.seacMap = properties.seacMap;
|
||||||
|
|
||||||
this.loading = true;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
Font.getFontID = (function () {
|
Font.getFontID = (function () {
|
||||||
@ -1261,7 +1259,6 @@ var Font = (function FontClosure() {
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
this.loadedName = fontName.split('-')[0];
|
this.loadedName = fontName.split('-')[0];
|
||||||
this.loading = false;
|
|
||||||
this.fontType = getFontType(type, subtype);
|
this.fontType = getFontType(type, subtype);
|
||||||
},
|
},
|
||||||
|
|
||||||
@ -2944,7 +2941,7 @@ var ErrorFont = (function ErrorFontClosure() {
|
|||||||
function ErrorFont(error) {
|
function ErrorFont(error) {
|
||||||
this.error = error;
|
this.error = error;
|
||||||
this.loadedName = 'g_font_error';
|
this.loadedName = 'g_font_error';
|
||||||
this.loading = false;
|
this.missingFile = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
ErrorFont.prototype = {
|
ErrorFont.prototype = {
|
||||||
|
@ -120,7 +120,7 @@ if (typeof PDFJSDev === 'undefined' || !PDFJSDev.test('MOZCENTRAL')) {
|
|||||||
|
|
||||||
// Add the font to the DOM only once or skip if the font
|
// Add the font to the DOM only once or skip if the font
|
||||||
// is already loaded.
|
// is already loaded.
|
||||||
if (font.attached || font.loading === false) {
|
if (font.attached || font.missingFile) {
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
font.attached = true;
|
font.attached = true;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user