Automattic/node-canvas

Right-aligned text with leading/trailing spaces rendered incorrectly

オープン

#333 opened on 2013/10/01

 (9 件のコメント) (1 件のリアクション) (0 人の担当者)JavaScript (1,195 件のフォーク)batch import
BugHelp wantedText & Fonts

Repository metrics

Stars
 (10,689 個のスター)
PR merge metrics
 (PR metrics pending)

説明

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

コントリビューターガイド