From e565e455e2a72b1b1fae4afe1c176a6ff0b4bdf1 Mon Sep 17 00:00:00 2001 From: Calixte Denizet Date: Sat, 7 Jan 2023 13:45:01 +0100 Subject: [PATCH] Set ExpansionFactor to 0.06 when it's equals to 0 in the private dict of CFF fonts --- src/core/cff_parser.js | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/core/cff_parser.js b/src/core/cff_parser.js index 44e0b481e..d61a7f514 100644 --- a/src/core/cff_parser.js +++ b/src/core/cff_parser.js @@ -792,6 +792,12 @@ class CFFParser { ); parentDict.privateDict = privateDict; + if (privateDict.getByName("ExpansionFactor") === 0) { + // Firefox doesn't render correctly such a font on Windows (see issue + // 15289), hence we just reset it to its default value. + privateDict.setByName("ExpansionFactor", 0.06); + } + // Parse the Subrs index also since it's relative to the private dict. if (!privateDict.getByName("Subrs")) { return;