mooman219 / fontdue

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

Line breaks when max_width is None #42

Closed bschwind closed 4 years ago

bschwind commented 4 years ago

Hi,

I'm not sure what the intended behavior is here, but when max_width is set to None in LayoutSettings, hard line breaks have no effect. Relevant code:

https://github.com/mooman219/fontdue/blob/3e2f51fe70fd7ab21ff70652ff8c2798f6e9fc65/src/layout.rs#L200

If this is intentional then that's totally fine, I'll specify a relevant maximum width.

Thanks for the great library!

mooman219 commented 4 years ago

Soft breaks can't happen when there's no max width, but there can be hard breaks. I'll fix that for 0.4

bschwind commented 4 years ago

Makes sense, much appreciated!

mooman219 commented 4 years ago

Should be fixed with the rewrite. Feel free to reopen this if it still shows up in 0.4 (not yet published, but on HEAD)