Skip to content

Commit

Permalink
Set ExpansionFactor to 0.06 when it's equals to 0 in the private dict…
Browse files Browse the repository at this point in the history
… of CFF fonts
  • Loading branch information
calixteman committed Jan 7, 2023
1 parent 38e46e7 commit e565e45
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions src/core/cff_parser.js
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

0 comments on commit e565e45

Please sign in to comment.