Skip to content

Commit

Permalink
For missing font, use a local font if it exists even if there's no st…
Browse files Browse the repository at this point in the history
…andard substitution

If the font foo is missing we just try lo load local(foo) and maybe
we'll be lucky.
  • Loading branch information
calixteman committed May 13, 2023
1 parent e738e15 commit d1cc458
Showing 1 changed file with 18 additions and 18 deletions.
36 changes: 18 additions & 18 deletions src/core/evaluator.js
Original file line number Diff line number Diff line change
Expand Up @@ -4197,15 +4197,15 @@ class PartialEvaluator {
if (standardFontName) {
file = await this.fetchStandardFontData(standardFontName);
properties.isInternalFont = !!file;
if (!properties.isInternalFont && this.options.useSystemFonts) {
properties.systemFontInfo = getFontSubstitution(
this.systemFontCache,
this.idFactory,
this.options.standardFontDataUrl,
baseFontName,
standardFontName
);
}
}
if (!properties.isInternalFont && this.options.useSystemFonts) {
properties.systemFontInfo = getFontSubstitution(
this.systemFontCache,
this.idFactory,
this.options.standardFontDataUrl,
baseFontName,
standardFontName
);
}
return this.extractDataStructures(dict, dict, properties).then(
newProperties => {
Expand Down Expand Up @@ -4310,15 +4310,15 @@ class PartialEvaluator {
if (standardFontName) {
fontFile = await this.fetchStandardFontData(standardFontName);
isInternalFont = !!fontFile;
if (!isInternalFont && this.options.useSystemFonts) {
systemFontInfo = getFontSubstitution(
this.systemFontCache,
this.idFactory,
this.options.standardFontDataUrl,
fontName.name,
standardFontName
);
}
}
if (!isInternalFont && this.options.useSystemFonts) {
systemFontInfo = getFontSubstitution(
this.systemFontCache,
this.idFactory,
this.options.standardFontDataUrl,
fontName.name,
standardFontName
);
}
}

Expand Down

0 comments on commit d1cc458

Please sign in to comment.