From d58040aa29417ed8d9d27abc9835c87047ac3c37 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=B7=B4=E9=87=8C=E5=88=87=E7=BD=97?= Date: Thu, 27 Apr 2017 18:31:06 +0800 Subject: [PATCH] fix(svg) char spacing bug --- src/display/svg.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/display/svg.js b/src/display/svg.js index a000bde69..0e8ef7a92 100644 --- a/src/display/svg.js +++ b/src/display/svg.js @@ -693,7 +693,8 @@ SVGGraphics = (function SVGGraphicsClosure() { var width = glyph.width; var character = glyph.fontChar; - var charWidth = width * widthAdvanceScale + charSpacing * fontDirection; + var spacing = (glyph.isSpace ? wordSpacing : 0) + charSpacing; + var charWidth = width * widthAdvanceScale + spacing * fontDirection; x += charWidth; current.tspan.textContent += character;