Skip to content

Commit

Permalink
Always use standard font data, with disableFontFace set in the API …
Browse files Browse the repository at this point in the history
…(PR 12726 follow-up)

We must force-fetch standard font data, when `disableFontFace = true` is set in the API, since otherwise rendering in e.g. the viewer is still broken (same as before PR 12726 landed).

*Please note:* We still need to also load standard font data for patterns and/or some text-rendering modes, however that will require larger changes so I figured that it cannot hurt to submit *this* patch right now.
  • Loading branch information
Snuffleupagus committed Jun 9, 2021
1 parent 6d88d8c commit 0f89083
Showing 1 changed file with 11 additions and 8 deletions.
19 changes: 11 additions & 8 deletions src/core/evaluator.js
Original file line number Diff line number Diff line change
Expand Up @@ -390,15 +390,18 @@ class PartialEvaluator {
}

async fetchStandardFontData(name) {
// The symbol fonts are not consistent across platforms, always load the
// font data for them.
if (
this.options.useSystemFonts &&
name !== "Symbol" &&
name !== "ZapfDingbats"
) {
return null;
if (!this.options.disableFontFace) {
// The symbol fonts are not consistent across platforms, always load the
// font data for them.
if (
this.options.useSystemFonts &&
name !== "Symbol" &&
name !== "ZapfDingbats"
) {
return null;
}
}

const standardFontNameToFileName = getFontNameToFileMap();
const filename = standardFontNameToFileName[name];
if (this.options.standardFontDataUrl !== null) {
Expand Down

0 comments on commit 0f89083

Please sign in to comment.