Merge pull request #15900 from calixteman/15289

Set ExpansionFactor to 0.06 when it's equals to 0 in the private dict of CFF fonts
This commit is contained in:
calixteman 2023-01-07 16:13:33 +01:00 committed by GitHub
commit e1f7355de4
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

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;