The mcu simulator builds i-slint-core with the std feature, but debug_log maybe
used in #[no_std] contexts, so we need to use a re-export rather than rely on std
being present
The loop was skipping one of the stop to interpolate
because when one iterator was returning None, the other
one had also advenced and its result discared.
We can just unwrap the value instead from the longer chain.
For the radial gradiant, we need to interpolate the last
colors to avoid a flash at the beginning for all the area
"outside" the circle.
We changed the MSRV in the last release because some dependency depended on
Rust 1.59. But that did not concern the C++ build, for example.
Now that we rely on rust 1.59 in our own code, we should make it explicit
so that the compilation error show the proper error
Separate the text shaping functionality from font metrics by having a
FontMetrics trait next to the TextShaper. AbstractFont is the combining
super trait. This allows eliminating the font height member from
TextParagraphLayout and improving the overall naming of fields and
types.
Finally, this prepares the API for composability of TextShaper for font
fallback handling.
Use the term glyph cluster instead of grapheme where we're dealing with
the glyphs for line breaking. Those may coincide with grapheme
boundaries, but aren't required to.
Replace the abstract glyph trait with a glyph struct. That way the text
layout code can operate properly on a struct with fields, instead of on
functions on a trait (some of which returning a mutable reference). The
input is a glyph with offset, advance, etc. - everything needed for the
layout and the output is a position along with the platform specific
glyph data.
Remove the font reference field anymore as it's not needed anymore and
remove the manual clone implementations. Those were needed because
otherwise the TextShaper trait would have to also support clone - as
[derive(Clone)] imposes that. Now we can impose that just on Glyph and
that's easy and makes sense.
Replace the lazy text shaping with an up-front shaping of all text. It
needs to be done eventually anyway, so by doing it in one go we can
avoid interior mutability and simplify the code overall.
Make ShapeBoundaries produce single offsets, there's no need for
ranges as the boundaries are contiguous.
In GraphemeCursor collect all boundaries in one go as text runs, to
simplify state handling. This will be needed anyway for recording bidi
runs in the future.
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.
The unicode linebreak iterator always produces a mandatory break at end
of text. This is not only confusing, but also inconsistent with the
simple line break iterator and with trailing spaces it could cause the
line break algorithm to emit empty lines at the end of text.
* janitor: Fix clippy error in textlayout.rs
This one is almost certainly a bug.
* janitor: clippy fixes in inline_expressions.rs
Clippy claims the original code was slower and less clean, so let's
change this.