Set ExpansionFactor to 0.06 when it's equals to 0 in the private dict of CFF fonts

This commit is contained in:
Calixte Denizet 2023-01-07 13:45:01 +01:00
parent 38e46e7614
commit e565e455e2

View File

@ -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;