Merge pull request #17674 from calixteman/issue17671
Fix the endoffset of the last glyph when it's followed by a null offset in the loca table
This commit is contained in:
commit
a83a8d7e4f
@ -2117,6 +2117,14 @@ class Font {
|
|||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// If the last offset is 0 in the loca table then we can't compute the
|
||||||
|
// endOffset for the last glyph. So in such a case we set the endOffset
|
||||||
|
// to the end of the data (fixes issue #17671).
|
||||||
|
const last = locaEntries.at(-2);
|
||||||
|
if (last.offset !== 0 && last.endOffset === 0) {
|
||||||
|
last.endOffset = oldGlyfDataLength;
|
||||||
|
}
|
||||||
|
|
||||||
const missingGlyphs = Object.create(null);
|
const missingGlyphs = Object.create(null);
|
||||||
let writeOffset = 0;
|
let writeOffset = 0;
|
||||||
itemEncode(locaData, 0, writeOffset);
|
itemEncode(locaData, 0, writeOffset);
|
||||||
|
1
test/pdfs/.gitignore
vendored
1
test/pdfs/.gitignore
vendored
@ -628,3 +628,4 @@
|
|||||||
!issue17492.pdf
|
!issue17492.pdf
|
||||||
!issue17540.pdf
|
!issue17540.pdf
|
||||||
!bug1669097.pdf
|
!bug1669097.pdf
|
||||||
|
!issue17671.pdf
|
||||||
|
BIN
test/pdfs/issue17671.pdf
Executable file
BIN
test/pdfs/issue17671.pdf
Executable file
Binary file not shown.
@ -9675,5 +9675,12 @@
|
|||||||
"id": null
|
"id": null
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"id": "issue17671",
|
||||||
|
"file": "pdfs/issue17671.pdf",
|
||||||
|
"md5": "407695b36b4611bc7c501a891c8a4b28",
|
||||||
|
"rounds": 1,
|
||||||
|
"type": "eq"
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
|
Loading…
x
Reference in New Issue
Block a user