Disables Font Loading API for Firefox.
This commit is contained in:
parent
e48f388d24
commit
e336604ef1
@ -118,6 +118,10 @@ FontLoader.prototype = {
|
|||||||
warn('Failed to load font "' + nativeFontFace.family + '": ' + e);
|
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++) {
|
for (var i = 0, ii = fonts.length; i < ii; i++) {
|
||||||
var font = fonts[i];
|
var font = fonts[i];
|
||||||
|
|
||||||
@ -128,7 +132,7 @@ FontLoader.prototype = {
|
|||||||
}
|
}
|
||||||
font.attached = true;
|
font.attached = true;
|
||||||
|
|
||||||
if (FontLoader.isFontLoadingAPISupported) {
|
if (isFontLoadingAPISupported) {
|
||||||
var nativeFontFace = font.createNativeFontFace();
|
var nativeFontFace = font.createNativeFontFace();
|
||||||
if (nativeFontFace) {
|
if (nativeFontFace) {
|
||||||
this.addNativeFontFace(nativeFontFace);
|
this.addNativeFontFace(nativeFontFace);
|
||||||
@ -145,7 +149,7 @@ FontLoader.prototype = {
|
|||||||
}
|
}
|
||||||
|
|
||||||
var request = this.queueLoadingCallback(callback);
|
var request = this.queueLoadingCallback(callback);
|
||||||
if (FontLoader.isFontLoadingAPISupported) {
|
if (isFontLoadingAPISupported) {
|
||||||
Promise.all(fontLoadPromises).then(function() {
|
Promise.all(fontLoadPromises).then(function() {
|
||||||
request.complete();
|
request.complete();
|
||||||
});
|
});
|
||||||
|
Loading…
x
Reference in New Issue
Block a user