From ab95cea6560b9a8ba20f6290603e7e6e8f4bd02b Mon Sep 17 00:00:00 2001 From: opengraphica Date: Sun, 9 Jun 2024 00:55:16 -0400 Subject: [PATCH] Font is treated as a required argument --- src/glyph.mjs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/glyph.mjs b/src/glyph.mjs index 3b9da2b7..93218645 100644 --- a/src/glyph.mjs +++ b/src/glyph.mjs @@ -357,7 +357,7 @@ Glyph.prototype.getMetrics = function() { * @param {opentype.Font} font - if hinting is to be used, or CPAL/COLR / variation needs to be rendered, the font */ Glyph.prototype.draw = function(ctx, x, y, fontSize, options, font) { - options = Object.assign({}, font.defaultRenderOptions, options); + options = Object.assign({}, font && font.defaultRenderOptions, options); const path = this.getPath(x, y, fontSize, options, font); path.draw(ctx); };