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
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
* 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
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.
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
Updated the version from 1.1 to 1.2
Renamed the header to "Slint Royalty-free Desktop, Mobile, and Web Applications License"
Added definition of "Mobile Application" and grant of right
Moved "Limitations" to 3rd section and "License Conditions - Attributions" to 2nd section
Added flexibility to choose between showing "MadeWithSlint" as a dialog/splash screen or on a public webpage
Moved the para on copyright notices to section under "Limitations"
Only the hand-picked sensible things, not all of it ;-)
Also fix a few typos that cspell complained about when I
tried to commit and some formatting changes that cargo fmt
insisted on when commiting.
For tiling, we will need to know the actual source size in addition to
the scaling factor that can be different. So store the scaling factors
in the scene command, as well as an offset where to start.
This is more accurate in case of clipping and rotation.
For rotation that doesn't matter (appart from the fact that the testing
can now be more strict)
But for clipping this prevent glitches with partial rendering where it
would seem like the image are moving a bit by a pixel when it is redrawn
with a different clip
* Extend the cspell word list
* Remove those extensions from individual source files
* white-list licenses and such as we should not meddle with those
* Fix spelling
TODO:
- Polish the API
- Most screenshot test are failling because the rotation don't draw the
rounded rectangle exactly the same (that's because the border
rectangle algo is not perfect), and also scaled image are not pixel
perfect
The updated screenshot is because of a small change in the image
rendering algorithm that changes the rounding slightly.
Implement the partial rendering with winit and our software renderer.
When the background is not opaque, we must still initialize all the
pixel with 0 otherwise we blend over the previous frame.
(That wasn't visible before because the buffer was always empty)
Implement rgb::Pod/rgb::Zeroable for PremultipliedRgbaColor and Rgb565
Pixel. This allows for bytemuck::cast_slice(), making it easier to copy
software renderer output into another buffer that's the same format but
Vec<u8> for example.