Merge pull request #20799 from Snuffleupagus/readPostScriptTable-getString

Use `BaseStream.prototype.getString` in the `readPostScriptTable` function
This commit is contained in:
Tim van der Meij 2026-03-05 20:40:59 +01:00 committed by GitHub
commit 7e48938009
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -2255,15 +2255,11 @@ class Font {
if (!valid) {
break;
}
const customNames = [],
strBuf = [];
const customNames = [];
while (font.pos < end) {
const stringLength = font.getByte();
strBuf.length = stringLength;
for (i = 0; i < stringLength; ++i) {
strBuf[i] = String.fromCharCode(font.getByte());
}
customNames.push(strBuf.join(""));
const strLen = font.getByte(),
str = font.getString(strLen);
customNames.push(str);
}
glyphNames = [];
for (i = 0; i < numGlyphs; ++i) {