Automattic/node-canvas

Right-aligned text with leading/trailing spaces rendered incorrectly

Open

#333 创建于 2013年10月1日

在 GitHub 查看
 (9 评论) (1 反应) (0 负责人)JavaScript (1,140 fork)batch import
BugHelp wantedText & Fonts

仓库指标

Star
 (9,524 star)
PR 合并指标
 (平均合并 34天 18小时) (30 天内合并 2 个 PR)

描述

Using a simple test like this:

ctx.font = '30px Arial';
ctx.textAlign = 'right';
ctx.strokeRect(100, 100, 100, 100);
ctx.fillText('   foobar', 100, 100);

... I'm getting incorrect rendering in latest node-canvas:

leading_spaces_nodecanvas

compare to the same output in Chrome (and FF):

leading_spaces_chrome

There's a similar problem with trailing spaces.

node-canvas:

trailing_spaces_nodecanvas

Chrome (FF):

trailing_spaces_chrome

贡献者指南