From 4fcd6149062935ed593a9fa360706003df163768 Mon Sep 17 00:00:00 2001 From: Johann Date: Sat, 11 Jul 2015 07:30:43 +0200 Subject: [PATCH] Add fallback for missing font option in canvas/text --- modes/canvas/text.js | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/modes/canvas/text.js b/modes/canvas/text.js index 5381f07..9606987 100644 --- a/modes/canvas/text.js +++ b/modes/canvas/text.js @@ -23,8 +23,11 @@ module.exports = Class(Base, { (font.fontWeight || font['font-weight'] || '') + ' ' + em + 'px ' + (font.fontFamily || font['font-family'] || 'Arial'); - } else { + } else if(this._font) { font = this._font; + } else { + em = 12; + font = '12px Arial'; } var lines = text && text.split(/\r?\n/);