mooman219 / fontdue

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

Possible word wrapping error when allowing wrap_hard_breaks #39

Closed hasenbanck closed 4 years ago

hasenbanck commented 4 years ago

Hi.

Given the following string: https://github.com/emilk/egui/blob/a35fe7da126f82dcdf3738a250e150a5ff5d30bb/egui/src/demos/mod.rs#L19

I get the following output (please ignore the miss aligned glyphs for now):

render

I used the following layout settings:

        let settings = LayoutSettings {
            max_width: max_width_in_points,
            wrap_hard_breaks: true,
            ..Default::default()
        };

Given these settings I would assume that line breaks are honoured and I get an empty line between the paragraphs. It also seems that after the line break, the wrapping isn't working anymore.

Is this the expected behaviour?

mooman219 commented 4 years ago

That's incorrect and should be fixed. I'm doing a layout rewrite for 0.4 which will include this fix.

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)