Set CFF header to 4 when writing it because it contains 4 elements (#13149)

This commit is contained in:
calixteman 2021-03-26 18:23:18 +01:00 committed by GitHub
parent 63471bcbbe
commit 81c602c61c
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 10 additions and 1 deletions

View File

@ -1556,7 +1556,9 @@ class CFFCompiler {
}
compileHeader(header) {
return [header.major, header.minor, header.hdrSize, header.offSize];
// `header.hdrSize` can be any value but we only write 4 values
// so header size is 4 (prevents OTS from rejecting the font).
return [header.major, header.minor, 4, header.offSize];
}
compileNameIndex(names) {

View File

@ -337,6 +337,7 @@
!issue4573.pdf
!issue4722.pdf
!issue4800.pdf
!issue13147.pdf
!issue11477_reduced.pdf
!text_clip_cff_cid.pdf
!issue4801.pdf

BIN
test/pdfs/issue13147.pdf Normal file

Binary file not shown.

View File

@ -653,6 +653,12 @@
"link": false,
"type": "text"
},
{ "id": "issue13147",
"file": "pdfs/issue13147.pdf",
"md5": "83db23f29b5e1a80d31d5069299e29cc",
"rounds": 1,
"type": "eq"
},
{ "id": "fit11-talk",
"file": "pdfs/fit11-talk.pdf",
"md5": "eb7b224107205db4fea9f7df0185f77d",