From 69477bfb06291cde12e5ca4b873ffe8f1c575985 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 | 18 ++++++++++-------- 1 file changed, 10 insertions(+), 8 deletions(-) diff --git a/src/core/evaluator.js b/src/core/evaluator.js index e1575cdf6..642e6aa47 100644 --- a/src/core/evaluator.js +++ b/src/core/evaluator.js @@ -397,14 +397,16 @@ class PartialEvaluator { return new Stream(cachedData); } - // The symbol fonts are not consistent across platforms, always load the - // standard 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 + // standard font data for them. + if ( + this.options.useSystemFonts && + name !== "Symbol" && + name !== "ZapfDingbats" + ) { + return null; + } } const standardFontNameToFileName = getFontNameToFileMap(),