Merge pull request #21322 from Snuffleupagus/fontFile-lookup-shorten

Shorten the `fontFile` lookup a tiny bit
This commit is contained in:
Tim van der Meij 2026-05-24 14:33:25 +02:00 committed by GitHub
commit 46b16bd42e
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 5 additions and 12 deletions

View File

@ -4666,18 +4666,11 @@ class PartialEvaluator {
let fontFile, fontFileN, subtype, length1, length2, length3;
try {
fontFile = descriptor.get("FontFile");
if (fontFile) {
fontFileN = 1;
} else {
fontFile = descriptor.get("FontFile2");
for (const n of ["FontFile", "FontFile2", "FontFile3"]) {
fontFile = descriptor.get(n);
if (fontFile) {
fontFileN = 2;
} else {
fontFile = descriptor.get("FontFile3");
if (fontFile) {
fontFileN = 3;
}
fontFileN = n;
break;
}
}

View File

@ -2698,7 +2698,7 @@ class Font {
if (
(header.version === "OTTO" &&
(!properties.composite ||
(properties.fontFileN === 3 && parsedCff?.isCIDFont))) ||
(properties.fontFileN === "FontFile3" && parsedCff?.isCIDFont))) ||
!tables.head ||
!tables.hhea ||
!tables.maxp ||