1
0
Fork 0
mirror of https://github.com/mozilla/pdf.js.git synced 2025-04-25 17:48:07 +02:00

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) {