mirror of
https://github.com/zen-browser/pdf.js.git
synced 2025-07-09 17:55:37 +02:00
Send UnsupportedFeature
notification when errors are ignored in FontFaceObject.getPathGenerator
This commit is contained in:
parent
bf0db0fb72
commit
0958006713
2 changed files with 19 additions and 10 deletions
|
@ -14,7 +14,8 @@
|
|||
*/
|
||||
|
||||
import {
|
||||
assert, bytesToString, isEvalSupported, shadow, string32, warn
|
||||
assert, bytesToString, isEvalSupported, shadow, string32,
|
||||
UNSUPPORTED_FEATURES, warn
|
||||
} from '../shared/util';
|
||||
|
||||
function FontLoader(docId) {
|
||||
|
@ -339,6 +340,7 @@ var FontFaceObject = (function FontFaceObjectClosure() {
|
|||
function FontFaceObject(translatedData, { isEvalSupported = true,
|
||||
disableFontFace = false,
|
||||
ignoreErrors = false,
|
||||
onUnsupportedFeature = null,
|
||||
fontRegistry = null, }) {
|
||||
this.compiledGlyphs = Object.create(null);
|
||||
// importing translated data
|
||||
|
@ -348,6 +350,7 @@ var FontFaceObject = (function FontFaceObjectClosure() {
|
|||
this.isEvalSupported = isEvalSupported !== false;
|
||||
this.disableFontFace = disableFontFace === true;
|
||||
this.ignoreErrors = ignoreErrors === true;
|
||||
this._onUnsupportedFeature = onUnsupportedFeature;
|
||||
this.fontRegistry = fontRegistry;
|
||||
}
|
||||
FontFaceObject.prototype = {
|
||||
|
@ -399,6 +402,9 @@ var FontFaceObject = (function FontFaceObjectClosure() {
|
|||
if (!this.ignoreErrors) {
|
||||
throw ex;
|
||||
}
|
||||
if (this._onUnsupportedFeature) {
|
||||
this._onUnsupportedFeature({ featureId: UNSUPPORTED_FEATURES.font, });
|
||||
}
|
||||
warn(`getPathGenerator - ignoring character: "${ex}".`);
|
||||
|
||||
return this.compiledGlyphs[character] = function(c, size) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue