Skip to content

Commit

Permalink
Disables Font Loading API for Firefox.
Browse files Browse the repository at this point in the history
  • Loading branch information
yurydelendik committed Oct 6, 2016
1 parent e48f388 commit e336604
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions src/display/font_loader.js
Original file line number Diff line number Diff line change
Expand Up @@ -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];

Expand All @@ -128,7 +132,7 @@ FontLoader.prototype = {
}
font.attached = true;

if (FontLoader.isFontLoadingAPISupported) {
if (isFontLoadingAPISupported) {
var nativeFontFace = font.createNativeFontFace();
if (nativeFontFace) {
this.addNativeFontFace(nativeFontFace);
Expand All @@ -145,7 +149,7 @@ FontLoader.prototype = {
}

var request = this.queueLoadingCallback(callback);
if (FontLoader.isFontLoadingAPISupported) {
if (isFontLoadingAPISupported) {
Promise.all(fontLoadPromises).then(function() {
request.complete();
});
Expand Down

0 comments on commit e336604

Please sign in to comment.