Skip to content

Commit 835b5ff

Browse files
committed
Only check isType3Font the first time that TranslatedFont.loadType3Data is called
If the `TranslatedFont.type3Loaded` property exists, then you already know that the font must be a Type3 one.
1 parent f3ff526 commit 835b5ff

File tree

1 file changed

+3
-4
lines changed

1 file changed

+3
-4
lines changed

src/core/evaluator.js

+3-4
Original file line numberDiff line numberDiff line change
@@ -3378,13 +3378,12 @@ class TranslatedFont {
33783378
}
33793379

33803380
loadType3Data(evaluator, resources, task) {
3381-
if (!this.font.isType3Font) {
3382-
throw new Error("Must be a Type3 font.");
3383-
}
3384-
33853381
if (this.type3Loaded) {
33863382
return this.type3Loaded;
33873383
}
3384+
if (!this.font.isType3Font) {
3385+
throw new Error("Must be a Type3 font.");
3386+
}
33883387
// When parsing Type3 glyphs, always ignore them if there are errors.
33893388
// Compared to the parsing of e.g. an entire page, it doesn't really
33903389
// make sense to only be able to render a Type3 glyph partially.

0 commit comments

Comments
 (0)