Skip to content

Commit 7ae3e13

Browse files
Merge pull request #12450 from janpe2/cff-xuid
Fix invalid `XUID` entries in CFF fonts
2 parents 10e7623 + 935568c commit 7ae3e13

File tree

4 files changed

+13
-0
lines changed

4 files changed

+13
-0
lines changed

src/core/cff_parser.js

+6
Original file line numberDiff line numberDiff line change
@@ -1407,6 +1407,12 @@ class CFFCompiler {
14071407
}
14081408
}
14091409

1410+
const xuid = cff.topDict.getByName("XUID");
1411+
if (xuid && xuid.length > 16) {
1412+
// Length of XUID array must not be greater than 16 (issue #12399).
1413+
cff.topDict.removeByName("XUID");
1414+
}
1415+
14101416
cff.topDict.setByName("charset", 0);
14111417
var compiled = this.compileTopDicts(
14121418
[cff.topDict],

test/pdfs/.gitignore

+1
Original file line numberDiff line numberDiff line change
@@ -169,6 +169,7 @@
169169
!issue5202.pdf
170170
!images_1bit_grayscale.pdf
171171
!issue5280.pdf
172+
!issue12399_reduced.pdf
172173
!issue5677.pdf
173174
!issue5954.pdf
174175
!issue6612.pdf

test/pdfs/issue12399_reduced.pdf

7.38 KB
Binary file not shown.

test/test_manifest.json

+6
Original file line numberDiff line numberDiff line change
@@ -1914,6 +1914,12 @@
19141914
"type": "eq",
19151915
"about": "Please note that this file currently renders incorrectly."
19161916
},
1917+
{ "id": "issue12399",
1918+
"file": "pdfs/issue12399_reduced.pdf",
1919+
"md5": "01bdd258be93e10f8399708eecedbfd6",
1920+
"rounds": 1,
1921+
"type": "eq"
1922+
},
19171923
{ "id": "issue5808-text",
19181924
"file": "pdfs/issue5808.pdf",
19191925
"md5": "e0584dd540d7859d6c191aa53379692e",

0 commit comments

Comments
 (0)