mooman219 / fontdue

The fastest font renderer in the world, written in pure rust.
Apache License 2.0
1.38k stars 70 forks source link

Option to drop the rest of a line instead of wrapping #135

Open j0ru opened 1 year ago

j0ru commented 1 year ago

This would be useful for apps that only want to show a preview of the full text or only expect to have to display a single line, like idk. a program launcher ^^

This could be shoehorned into the WrapStyle as an Drop option with an optional suffix, i.e. Drop(Some("…"))

Thanks for the great library, have been using confidently it for a while now

mooman219 commented 1 year ago

I could add a WrapStyle::Abort or something that stops performing if we encounter a line break?

j0ru commented 1 year ago

Ah, I should have clarified. I mean when the max_width is exceeded. So instead of wrapping to a new line, the rest of the input is dropped