Automattic/node-canvas

Right-aligned text with leading/trailing spaces rendered incorrectly

開放

#333 建立於 2013年10月1日

 (9 則留言) (1 個反應) (0 位負責人)JavaScript (1,195 個分叉)batch import
BugHelp wantedText & Fonts

倉庫指標

星標
 (10,689 顆星)
PR 合併指標
 (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

貢獻者指南