From 3dcbf99f947651e63f3bf5e0185007b01ea2aa3b Mon Sep 17 00:00:00 2001 From: Graham Kane Date: Mon, 29 Jul 2019 16:25:17 +0100 Subject: [PATCH] support font-family names with numbers in (e.g. Font Awesome 5) --- src/render/canvas/canvas-renderer.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/render/canvas/canvas-renderer.ts b/src/render/canvas/canvas-renderer.ts index d15ed1e..7060c0b 100644 --- a/src/render/canvas/canvas-renderer.ts +++ b/src/render/canvas/canvas-renderer.ts @@ -155,7 +155,7 @@ export class CanvasRenderer { const fontVariant = styles.fontVariant .filter(variant => variant === 'normal' || variant === 'small-caps') .join(''); - const fontFamily = styles.fontFamily.join(', '); + const fontFamily = styles.fontFamily.map(fontFamily => `"${fontFamily}"`).join(', '); const fontSize = isDimensionToken(styles.fontSize) ? `${styles.fontSize.number}${styles.fontSize.unit}` : `${styles.fontSize.number}px`;