diff --git a/src/glyphset.mjs b/src/glyphset.mjs index 3e5dab58..4aaa6871 100644 --- a/src/glyphset.mjs +++ b/src/glyphset.mjs @@ -62,11 +62,11 @@ if(typeof Symbol !== 'undefined' && Symbol.iterator) { /** * @param {number} index - * @return {opentype.Glyph} + * @return {opentype.Glyph | undefined} */ GlyphSet.prototype.get = function(index) { // this.glyphs[index] is 'undefined' when low memory mode is on. glyph is pushed on request only. - if (this.glyphs[index] === undefined) { + if (this.font._push && this.glyphs[index] === undefined) { this.font._push(index); if (typeof this.glyphs[index] === 'function') { this.glyphs[index] = this.glyphs[index]();