diff --git a/src/pixie/fonts.nim b/src/pixie/fonts.nim index 8c61cf0..d0b79ad 100644 --- a/src/pixie/fonts.nim +++ b/src/pixie/fonts.nim @@ -137,7 +137,8 @@ proc typeset*( prevCanWrap = i let advance = glyphAdvance(result.runes, font, i) - if bounds.x > 0 and at.x + advance > bounds.x: # Wrap to new line + if rune != Rune(32) and bounds.x > 0 and at.x + advance > bounds.x: + # Wrap to new line at.x = 0 at.y += lineHeight diff --git a/tests/fonts/diffs/paragraph.png b/tests/fonts/diffs/paragraph.png index d3a68d4..2b466e5 100644 Binary files a/tests/fonts/diffs/paragraph.png and b/tests/fonts/diffs/paragraph.png differ diff --git a/tests/fonts/rendered/paragraph.png b/tests/fonts/rendered/paragraph.png index 006fd99..8933812 100644 Binary files a/tests/fonts/rendered/paragraph.png and b/tests/fonts/rendered/paragraph.png differ