alexheretic / glyph-brush

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

Text clipping #151

Closed samchouse closed 2 years ago

samchouse commented 2 years ago

I'm using glyph_brush_layout and was wondering if it's possible to click 1 long word.

Ex in Figma: Q2iOm3kQ

Using this library it would just break and error, and if I shorten it it would not respect bounds. If this is possible could I get some help on how to do it?

alexheretic commented 2 years ago

You can configure the line break logic, e.g. use BuiltInLineBreaker::AnyCharLineBreaker or define your own. I'm not sure if that'll be exactly what you need though, it'll work for a single long word though.

By default (UnicodeLineBreaker) words are never cut up in this way.

samchouse commented 2 years ago

Ok, thanks for the help