Skip to content

Commit

Permalink
Font is treated as a required argument
Browse files Browse the repository at this point in the history
  • Loading branch information
opengraphica committed Jun 9, 2024
1 parent 6fb5ee8 commit ab95cea
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/glyph.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -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);
};
Expand Down

0 comments on commit ab95cea

Please sign in to comment.