Skip to content

Commit ab95cea

Browse files
committed
Font is treated as a required argument
1 parent 6fb5ee8 commit ab95cea

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/glyph.mjs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -357,7 +357,7 @@ Glyph.prototype.getMetrics = function() {
357357
* @param {opentype.Font} font - if hinting is to be used, or CPAL/COLR / variation needs to be rendered, the font
358358
*/
359359
Glyph.prototype.draw = function(ctx, x, y, fontSize, options, font) {
360-
options = Object.assign({}, font.defaultRenderOptions, options);
360+
options = Object.assign({}, font && font.defaultRenderOptions, options);
361361
const path = this.getPath(x, y, fontSize, options, font);
362362
path.draw(ctx);
363363
};

0 commit comments

Comments
 (0)