Access this._onUnsupportedFeature directly in FontFaceObject.getPathGenerator

Given that `FontFaceObject` is not exposed in the public API, but only accessed internally, there's no need to assume that a `FontFaceObject`-instance is ever initialized without `onUnsupportedFeature` being provided. This is also consistent with the `BaseFontLoader` implementation.
This commit is contained in:
Jonas Jenwald 2021-01-29 16:29:16 +01:00
parent 5a522a5c71
commit fec8c4c43f

View File

@ -350,7 +350,7 @@ class FontFaceObject {
isEvalSupported = true, isEvalSupported = true,
disableFontFace = false, disableFontFace = false,
ignoreErrors = false, ignoreErrors = false,
onUnsupportedFeature = null, onUnsupportedFeature,
fontRegistry = null, fontRegistry = null,
} }
) { ) {
@ -405,11 +405,9 @@ class FontFaceObject {
if (!this.ignoreErrors) { if (!this.ignoreErrors) {
throw ex; throw ex;
} }
if (this._onUnsupportedFeature) { this._onUnsupportedFeature({
this._onUnsupportedFeature({ featureId: UNSUPPORTED_FEATURES.errorFontGetPath,
featureId: UNSUPPORTED_FEATURES.errorFontGetPath, });
});
}
warn(`getPathGenerator - ignoring character: "${ex}".`); warn(`getPathGenerator - ignoring character: "${ex}".`);
return (this.compiledGlyphs[character] = function (c, size) { return (this.compiledGlyphs[character] = function (c, size) {