Skip to content

Commit

Permalink
Only check isType3Font the first time that `TranslatedFont.loadType…
Browse files Browse the repository at this point in the history
…3Data` is called

If the `TranslatedFont.type3Loaded` property exists, then you already know that the font must be a Type3 one.
  • Loading branch information
Snuffleupagus committed Jul 27, 2020
1 parent f3ff526 commit 835b5ff
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions src/core/evaluator.js
Original file line number Diff line number Diff line change
Expand Up @@ -3378,13 +3378,12 @@ class TranslatedFont {
}

loadType3Data(evaluator, resources, task) {
if (!this.font.isType3Font) {
throw new Error("Must be a Type3 font.");
}

if (this.type3Loaded) {
return this.type3Loaded;
}
if (!this.font.isType3Font) {
throw new Error("Must be a Type3 font.");
}
// When parsing Type3 glyphs, always ignore them if there are errors.
// Compared to the parsing of e.g. an entire page, it doesn't really
// make sense to only be able to render a Type3 glyph partially.
Expand Down

0 comments on commit 835b5ff

Please sign in to comment.