support font-family names with numbers in (e.g. Font Awesome 5)

This commit is contained in:
Graham Kane 2019-07-29 16:25:17 +01:00
parent 9a63797aa7
commit 3dcbf99f94

View File

@ -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`;