Skip to content

Commit

Permalink
Remove ExpansionFactor equals to 0 from the private dict of CFF fonts
Browse files Browse the repository at this point in the history
  • Loading branch information
calixteman committed Jan 7, 2023
1 parent 38e46e7 commit 96490fb
Show file tree
Hide file tree
Showing 4 changed files with 14 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 remove the entry.
privateDict.removeByName("ExpansionFactor");
}

// Parse the Subrs index also since it's relative to the private dict.
if (!privateDict.getByName("Subrs")) {
return;
Expand Down
1 change: 1 addition & 0 deletions test/pdfs/.gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -564,3 +564,4 @@
!issue15815.pdf
!issue15818.pdf
!autoprint.pdf
!issue15289.pdf
Binary file added test/pdfs/issue15289.pdf
Binary file not shown.
7 changes: 7 additions & 0 deletions test/test_manifest.json
Original file line number Diff line number Diff line change
Expand Up @@ -7292,5 +7292,12 @@
"rounds": 1,
"link": true,
"type": "eq"
},
{
"id": "issue15289",
"file": "pdfs/issue15289.pdf",
"md5": "f3d20aee398e052ac3dce7cc030f50de",
"rounds": 1,
"type": "eq"
}
]

0 comments on commit 96490fb

Please sign in to comment.