From 0f89083201496ba595ec4b3334349aaa270c0c26 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 a07287c0165bf0..e552856afc3ce0 100644 --- a/src/core/evaluator.js +++ b/src/core/evaluator.js @@ -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) {