From bcdf7b46c58bbd573efe00ce242dab50899908a7 Mon Sep 17 00:00:00 2001 From: notmasteryet Date: Sun, 25 Mar 2012 14:31:28 -0500 Subject: [PATCH] Fixing advance after disabled symbols --- src/canvas.js | 40 ++++++++++++++++++++-------------------- 1 file changed, 20 insertions(+), 20 deletions(-) diff --git a/src/canvas.js b/src/canvas.js index 2528a6b3b..e915c4a84 100644 --- a/src/canvas.js +++ b/src/canvas.js @@ -751,31 +751,31 @@ var CanvasGraphics = (function CanvasGraphicsClosure() { x += Util.sign(current.fontMatrix[0]) * wordSpacing; continue; } - if (glyph.disabled) - continue; var char = glyph.fontChar; var charWidth = glyph.width * fontSize * 0.001 + Util.sign(current.fontMatrix[0]) * charSpacing; - var scaledX = x / fontSizeScale; - switch (textRenderingMode) { - default: // other unsupported rendering modes - case TextRenderingMode.FILL: - case TextRenderingMode.FILL_ADD_TO_PATH: - ctx.fillText(char, scaledX, 0); - break; - case TextRenderingMode.STROKE: - case TextRenderingMode.STROKE_ADD_TO_PATH: - ctx.strokeText(char, scaledX, 0); - break; - case TextRenderingMode.FILL_STROKE: - case TextRenderingMode.FILL_STROKE_ADD_TO_PATH: - ctx.fillText(char, scaledX, 0); - ctx.strokeText(char, scaledX, 0); - break; - case TextRenderingMode.INVISIBLE: - break; + if (!glyph.disabled) { + var scaledX = x / fontSizeScale; + switch (textRenderingMode) { + default: // other unsupported rendering modes + case TextRenderingMode.FILL: + case TextRenderingMode.FILL_ADD_TO_PATH: + ctx.fillText(char, scaledX, 0); + break; + case TextRenderingMode.STROKE: + case TextRenderingMode.STROKE_ADD_TO_PATH: + ctx.strokeText(char, scaledX, 0); + break; + case TextRenderingMode.FILL_STROKE: + case TextRenderingMode.FILL_STROKE_ADD_TO_PATH: + ctx.fillText(char, scaledX, 0); + ctx.strokeText(char, scaledX, 0); + break; + case TextRenderingMode.INVISIBLE: + break; + } } x += charWidth;