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