Skip to content

Commit 089b60d

Browse files
committed
Merge pull request mozilla#2463 from brendandahl/remove-cid-keys
Remove cid dictionary values for normalized fonts.
2 parents 179f3e3 + 575f2dd commit 089b60d

File tree

3 files changed

+13
-0
lines changed

3 files changed

+13
-0
lines changed

src/fonts.js

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5513,7 +5513,14 @@ var CFFParser = (function CFFParserClosure() {
55135513
}
55145514

55155515
var fontDict = cff.fdArray[0];
5516+
// Make the sanitizer happy and remove anything that is only for CID
5517+
// fonts.
55165518
fontDict.setByKey(17, topDict.getByName('CharStrings'));
5519+
fontDict.removeByName('CIDFontVersion');
5520+
fontDict.removeByName('CIDFontRevision');
5521+
fontDict.removeByName('CIDFontType');
5522+
fontDict.removeByName('CIDCount');
5523+
fontDict.removeByName('UIDBase');
55175524
cff.topDict = fontDict;
55185525
cff.isCIDFont = false;
55195526
delete cff.fdArray;

test/pdfs/cid_cff.pdf

19.5 KB
Binary file not shown.

test/test_manifest.json

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -795,5 +795,11 @@
795795
"md5": "9f11e815b485f7f0e1fa5c116c636cf9",
796796
"rounds": 1,
797797
"type": "eq"
798+
},
799+
{ "id": "cid_cff",
800+
"file": "pdfs/cid_cff.pdf",
801+
"md5": "a19a18eaa626262cc45e0760004d6de9",
802+
"rounds": 1,
803+
"type": "eq"
798804
}
799805
]

0 commit comments

Comments
 (0)