Commit graph

6 commits

Author SHA1 Message Date
Olivier Goffart
ad80e3e5e2 Fix software renderer line breaker without the unicode feature
This change makes the test pass without the unicode feature.

Note that it is not possible to run the test without the unicode feature
unless one changes the Cargo.toml, so I did that locally to run the
tests
2022-09-07 13:49:02 +02:00
Simon Hausmann
f1fb451791 Make the line break iterators implement Clone
This is needed in the future to be able to roll back state within the
line breaking when we can't fit even a single word into the line and
have to go back to fitting glyph by glyph.

For the unicode line break iterator the clone is a little more complicated.
The iterator is clone, but the type is anonymous. I first had an
implementation to moved the iterator into a closure, which was cloned
via another control closure. But that's complicated and still involves
allocating the various bits & pieces the closure captures.

So instead the simpler solution used here is to allocate the breaks
into a shared vector.
2022-05-13 17:33:01 +02:00
Simon Hausmann
0e16d7ef9f Fix build of tests with simple line breaker iterator
Add missing trait derivatives
2022-05-13 17:33:01 +02:00
Simon Hausmann
292db19c32 Simplify simple line break iterator
We don't need Option<char>, just a boolean is enough.
2022-05-13 17:33:01 +02:00
Simon Hausmann
2b93504b93 Fix MCU build 2022-04-14 11:31:39 +02:00
Simon Hausmann
4e18291290 Rename linebreak_ascii to linebreak_simple
It's not just strict ascii
2022-03-10 10:51:32 +01:00
Renamed from internal/core/textlayout/linebreak_ascii.rs (Browse further)