Skip to content

Stop showing the fallback bar for "errorFontLoadNative" errors (PR 10539 follow-up) #12931

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 4 additions & 6 deletions src/display/font_loader.js
Original file line number Diff line number Diff line change
Expand Up @@ -350,7 +350,7 @@ class FontFaceObject {
isEvalSupported = true,
disableFontFace = false,
ignoreErrors = false,
onUnsupportedFeature = null,
onUnsupportedFeature,
fontRegistry = null,
}
) {
Expand Down Expand Up @@ -405,11 +405,9 @@ class FontFaceObject {
if (!this.ignoreErrors) {
throw ex;
}
if (this._onUnsupportedFeature) {
this._onUnsupportedFeature({
featureId: UNSUPPORTED_FEATURES.errorFontGetPath,
});
}
this._onUnsupportedFeature({
featureId: UNSUPPORTED_FEATURES.errorFontGetPath,
});
warn(`getPathGenerator - ignoring character: "${ex}".`);

return (this.compiledGlyphs[character] = function (c, size) {
Expand Down
6 changes: 6 additions & 0 deletions web/app.js
Original file line number Diff line number Diff line change
Expand Up @@ -1089,6 +1089,12 @@ const PDFViewerApplication = {
featureId,
});

// Don't show the fallback bar for things that are *very* unlikely to cause
// user-visible errors, to avoid bothering the user unnecessarily.
switch (featureId) {
case UNSUPPORTED_FEATURES.errorFontLoadNative:
return;
}
// Only trigger the fallback once so we don't spam the user with messages
// for one PDF.
if (this.fellback) {
Expand Down