Automattic/node-canvas

Right-aligned text with leading/trailing spaces rendered incorrectly

Open

#333 geöffnet am 1. Okt. 2013

Auf GitHub ansehen
 (9 Kommentare) (1 Reaktion) (0 zugewiesene Personen)JavaScript (1.140 Forks)batch import
BugHelp wantedText & Fonts

Repository-Metriken

Stars
 (9.524 Stars)
PR-Merge-Metriken
 (Durchschn. Merge 34T 18h) (2 gemergte PRs in 30 T)

Beschreibung

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

Contributor Guide