From 77d258f1d8eeccf7e38235463a293b512c1ca3d0 Mon Sep 17 00:00:00 2001 From: Niklas von Hertzen Date: Tue, 12 Dec 2017 21:06:24 +0800 Subject: [PATCH] Fix rendering with multiple fonts defined (Fix #796) --- CHANGELOG.md | 1 + src/renderer/CanvasRenderer.js | 3 +-- tests/reftests/text/text.html | 2 ++ 3 files changed, 4 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 2c85496..6025cc0 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,6 +1,7 @@ ### Changelog ### #### v1.0.0-alpha4 - TBD #### + * Fix rendering with multiple fonts defined (Fix #796) * Add support for radial-gradients * Fix logging option (#1302) * Add support for rendering webgl canvas content (#646) diff --git a/src/renderer/CanvasRenderer.js b/src/renderer/CanvasRenderer.js index 781e60c..a65b13c 100644 --- a/src/renderer/CanvasRenderer.js +++ b/src/renderer/CanvasRenderer.js @@ -215,8 +215,7 @@ export default class CanvasRenderer implements RenderTarget { font.fontSize, font.fontFamily ] - .join(' ') - .split(',')[0]; + .join(' '); textBounds.forEach(text => { this.ctx.fillStyle = color.toString(); diff --git a/tests/reftests/text/text.html b/tests/reftests/text/text.html index b9fcf38..dc88367 100644 --- a/tests/reftests/text/text.html +++ b/tests/reftests/text/text.html @@ -131,5 +131,7 @@
  • font-variant:small-caps;
  • +
    npm install --save html2canvas
    +