alexheretic / glyph-brush

Fast GPU cached text rendering
Apache License 2.0
673 stars 52 forks source link

Omit whitespace line trailing glyphs #168

Closed alexheretic closed 8 months ago

alexheretic commented 8 months ago

Default layouts: Whitespace SectionGlyphs ignored for purposes of positioning are now also omitted entirely from GlyphPositioner::calculate_glyphs.

So right-aligned "foo b r" with ~3 char width bound, previously

foo|___
b_r|

Now

foo|
b_r|

Issues

This change may cause issues. Take a text editor use case. Previously the layout provide a position for all spaces, this could be used to render the cursor (like in https://github.com/alexheretic/glyph-brush/issues/130#issuecomment-781477924). By omitting the glyphs this would be much more painful. Not being able to reliably have these whitespace chars as glyphs could be an unwelcome change here.