mirror of
https://github.com/mozilla/pdf.js.git
synced 2026-05-31 07:11:00 +02:00
Merge pull request #21322 from Snuffleupagus/fontFile-lookup-shorten
Shorten the `fontFile` lookup a tiny bit
This commit is contained in:
commit
46b16bd42e
@ -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;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@ -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 ||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user