We had code on the window to reset the default-font-size property to the
default from the renderer.
For the Qt backend, the PopupWindow being their own Window, this code
was activated also for the PopupWindow's hidden default-font-size
property, which caused all PopupWindow's font to not follow the
default-font-size
Fixes#8855
Instead of using datastructure that are tailored to our line by line
renderer and draw functions, use more generic and future proof data that
are easier to handle by hardware accelerator, and may be easier to
stabilize.
The screenshots from the screenshots test have to be re-done
because the rounding is different
Note: the C++ API DrawTextureArgs is not exposed yet
... by changing the resolution for the `WindowItem` to traverse the
item tree from the current item, instead of going to the window.
This doesn't quite fix#4298 because `rem` resolution is still missing.
That requires the built-in default font size function to be fixed as
well, which is non-trivial.
cc #4298
We need to draw the background over the rotated rectangle otherwise we
don't fill the whole background.
Regression from https://github.com/slint-ui/slint/pull/7685
(also cleanup a useless blend that was leftover from the same change)
Adapt the screenshot test to have at least one non-square "window" so
that we catch the problem in the future
Remove the geometry field and merely store the offset/transform. This brings the size down from 40 to 32 bytes on aarch64.
Related, filter_item() now respects the item's bounding rect for the decision whether to draw the item or not.
And call `extern crate std` when the feature is enabled.
I've read this is the good practice on how to do it.
So that the std prelude is no longer included automatically.
There is then less difference between std and and no-std build which
should avoid surprises in the CI when we use things from the prelude.
The downside is that there is a bit of churn in the tests
The use of the rotation-* properties creates a hidden Rotate item,
which applyes a rotation to the renderer. This rotation (and translation
by rotation origin) is now also applied when the partial renderer
computes the dirty regions.
This fixes drawing the background of the live preview with the software
renderer.
The problem was that when a svg image is tiled (and the svg is not
pre-rendered), we would render the svg in a duffer the size of the
target. But that's not the size at which it should be rendered as it is
going to be tiled over this surface.
Too big images are not supported by the software renderer, it would
panic in overflows in diverse places. So this also fixes panics
* WIP: swrenderer: use fixed point for the pixmap font coordinate
* swrenderer: signed distance field: move the glyph to the middle
* swrenderer: round the advance instead of truncating it in distance field
* swrenderer: actually align the gplyph on the sub-pixel precision
sub-pixel within the source.
* swrenderer: adapt the threshold for signed distance field
sqrt(2) is the distance to the diagonal, seems like this gives sharper fonts
* Fix bug in the elision, and re-upload the screenshort
the screenshot changed because the afvanced is now rounded intead of
truncated
When rounded out, the dirty region might end up bigger than the size
of the screen, which would then result in panic while trying to draw a
pixel out of the screen.
Fixes#6932
That code was touched recently while doing the signed distance field
rendering. The offset is now within the source rectangle.
So the SharedBufferCommand's source_rect must include the whole pixmap.
Unfortunately, VectorFont are not covered by the screenshot tests
Instead of using the trick of taking a sub-slice and pretending the
image was smaller than it is.
Then this is more uniform with all the other rendering path.
And this should prevent the panic in #6643Fixes#6643
- include the ' ' char that doesn't have a bounding box but need to be
included for the advance_x
- Fix an off by one in rendering where the last pixel was missing
Everything is already working, just had to play around with a few cfgs. The sharedfontdb module already takes care of including DejaVuSans as default fallback font.
Instead, just ignore the rotation.
(Rotation is currently used in the live-preview to show the collapsed
items. It shouldn't cause a panic even if rotation is not showning)
CC: #3068
The struct held provides access to the design metrics of the font scaled
to the font pixel size used by the element.
ChangeLog: Slint Language: Added font-metrics property to `Text` and `TextInput`.
Closes#6047
We were assuming that the extra clip was always on a unrotated image,
the rendering code didn't account for rotated screens
ChangeLog: Software renderer: fix artifact with partial drawing and rotation