diff --git a/src/core/evaluator.js b/src/core/evaluator.js index b608feed6271a..3366967ce8a1d 100644 --- a/src/core/evaluator.js +++ b/src/core/evaluator.js @@ -4315,11 +4315,15 @@ class PartialEvaluator { dict, properties ); - if (widths) { + if (Array.isArray(widths)) { const glyphWidths = []; let j = firstChar; - for (const width of widths) { - glyphWidths[j++] = this.xref.fetchIfRef(width); + for (const w of widths) { + const width = this.xref.fetchIfRef(w); + if (typeof width === "number") { + glyphWidths[j] = width; + } + j++; } newProperties.widths = glyphWidths; } else {