mirror of
https://github.com/mozilla/pdf.js.git
synced 2026-06-03 00:31:01 +02:00
Shorten the fontFile lookup a tiny bit
Rather than effectively duplicating code, we can use a loop instead.
This commit is contained in:
parent
ea18e73de2
commit
31c6561b91
@ -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