From f12a3cbd0f507619399220db7b6b804e84d1dc4a Mon Sep 17 00:00:00 2001 From: Jonas Jenwald Date: Tue, 8 Jun 2021 17:40:32 +0200 Subject: [PATCH] Always use standard font data, with `disableFontFace` set in the API (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. --- src/core/evaluator.js | 19 +++++++++++-------- 1 file changed, 11 insertions(+), 8 deletions(-) diff --git a/src/core/evaluator.js b/src/core/evaluator.js index 243c225ba602ad..4bb0f825956068 100644 --- a/src/core/evaluator.js +++ b/src/core/evaluator.js @@ -389,15 +389,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 = getStdFontNameToFileMap(); const filename = standardFontNameToFileName[name]; if (this.options.standardFontDataUrl !== null) {