diff --git a/src/display/font_loader.js b/src/display/font_loader.js index 74f676c72..7fb31579f 100644 --- a/src/display/font_loader.js +++ b/src/display/font_loader.js @@ -118,6 +118,10 @@ FontLoader.prototype = { warn('Failed to load font "' + nativeFontFace.family + '": ' + e); }); }; + // Firefox Font Loading API does not work with mozPrintCallback -- + // disabling it in this case. + var isFontLoadingAPISupported = FontLoader.isFontLoadingAPISupported && + !FontLoader.isSyncFontLoadingSupported; for (var i = 0, ii = fonts.length; i < ii; i++) { var font = fonts[i]; @@ -128,7 +132,7 @@ FontLoader.prototype = { } font.attached = true; - if (FontLoader.isFontLoadingAPISupported) { + if (isFontLoadingAPISupported) { var nativeFontFace = font.createNativeFontFace(); if (nativeFontFace) { this.addNativeFontFace(nativeFontFace); @@ -145,7 +149,7 @@ FontLoader.prototype = { } var request = this.queueLoadingCallback(callback); - if (FontLoader.isFontLoadingAPISupported) { + if (isFontLoadingAPISupported) { Promise.all(fontLoadPromises).then(function() { request.complete(); });