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:
Jonas Jenwald 2018-08-16 20:34:37 +02:00
parent caf90ff6ee
commit ad3e937816
2 changed files with 2 additions and 5 deletions

View File

@ -589,8 +589,6 @@ var Font = (function FontClosure() {
this.toUnicode = properties.toUnicode;
this.encoding = properties.baseEncoding;
this.seacMap = properties.seacMap;
this.loading = true;
}
Font.getFontID = (function () {
@ -1261,7 +1259,6 @@ var Font = (function FontClosure() {
});
}
this.loadedName = fontName.split('-')[0];
this.loading = false;
this.fontType = getFontType(type, subtype);
},
@ -2944,7 +2941,7 @@ var ErrorFont = (function ErrorFontClosure() {
function ErrorFont(error) {
this.error = error;
this.loadedName = 'g_font_error';
this.loading = false;
this.missingFile = true;
}
ErrorFont.prototype = {

View File

@ -120,7 +120,7 @@ if (typeof PDFJSDev === 'undefined' || !PDFJSDev.test('MOZCENTRAL')) {
// Add the font to the DOM only once or skip if the font
// is already loaded.
if (font.attached || font.loading === false) {
if (font.attached || font.missingFile) {
continue;
}
font.attached = true;