Olivier Goffart
b620986e35
Fix 16bit blending
...
The comments were a bit off, and we were loosing one bit in the blue LSB
Reported in https://github.com/slint-ui/slint/pull/1576#pullrequestreview-1232577955
2023-01-05 12:08:21 +01:00
Simon Hausmann
a440894588
Prospective fix for loading fonts with the software renderer from the system on Linux
...
Try a few fallback families that usually exist, instead of querying fontconfig from corelib.
2022-12-16 18:20:12 +01:00
Simon Hausmann
bf8187fed1
Cache glyphs rendered from truetype fonts
...
and cache the fontdue::Font as well, since that's also slow to create.
2022-12-16 18:20:12 +01:00
Simon Hausmann
2b7d4e7793
Basic implementation of the last resort font fallback for fontdb
2022-12-16 18:20:12 +01:00
Simon Hausmann
d92c49e09c
Separate pixel and vector fonts into modules of their own
2022-12-16 18:20:12 +01:00
Simon Hausmann
dee1b11a83
Initial support for truetype fonts in the software renderer
...
This works, but it's super slow as for every glyph the font is loaded
again and the glyphs are rasterized every time they're drawn.
2022-12-16 18:20:12 +01:00
Simon Hausmann
7cf312667e
Remove internal duplicated FontMetrics trait
...
There's also one in the textlayout module and this was is just confusing as a trait.
2022-12-16 18:20:12 +01:00
Simon Hausmann
d69b4b81ba
Simplify glyph handling in the software renderer
...
Remove platform glyph abstraction, just use non-zero u16 as glyph index
like everyone else. As a bonus, this reduces the memory consumption of
the glyph buffers per glyph from a size of a pointer to the size of the
u16.
2022-12-16 18:20:12 +01:00
Olivier Goffart
830e33876f
swrenderer: Fix drawing of images
...
There was some confusin on the meaning of the alpha and colorize and how
it is computed for AlphaMap images
2022-11-30 16:49:23 +01:00
Florian Blasius
00bd4909e1
SoftwareRenderer: render texture with opacity and color alpha channel ( #1877 )
...
* swr: add alpha field to texture
2022-11-21 15:26:35 +01:00
Simon Hausmann
39121994ca
Always set Window.default-font-size
...
Permit the style metrics to provide a `default-font-size` and bind that
to the `Window` if set. If not provided, then the backend can set a
`default-font-size`. By ensuring that the value is non-zero at run-time,
we can later introduce a rem unit that can act as factor relative to
this non-zero font size.
2022-11-03 17:15:44 +01:00
Simon Hausmann
37a8c50c12
Simplify FontRequest
...
It doesn't have to be generic as mostly the frontend code creates it with logical lengths.
2022-09-30 23:31:32 +02:00
Simon Hausmann
a52d633b59
Change FontRequest to be a generic over the length
...
The API uses a logical length for pixel sizes and letter spacing,
but the renderer will need the physical length eventually.
2022-09-30 13:00:37 +02:00
Simon Hausmann
1624a66ebc
Change the Renderer trait's text related functions to explicitly operate on logical lengths
2022-09-30 13:00:37 +02:00
Simon Hausmann
d698af5326
Move physical length definitions into the software renderer
...
Their choice of i16 is specific to the software renderer. In say the Skia renderer
the physical coordinate space would still use Skia's Scalar (floating points).
2022-09-30 09:03:02 +02:00
Olivier Goffart
36845dcbab
Support drawing embedded textures with the non-software renderers
2022-09-07 18:44:14 +02:00
Olivier Goffart
1ba4450115
Apply suggestions from code review
...
Co-authored-by: Simon Hausmann <simon.hausmann@slint-ui.com>
2022-09-07 17:11:57 +02:00
Olivier Goffart
abbf1edd91
Better error message when using the software renderer with a .slint file not compiled for it
2022-09-07 17:11:57 +02:00
Tobias Hunger
639dcaf702
api: Rename module swrenderer
to software_renderer
...
Also rename the `swrenderer` feature to `software-renderer`.
2022-09-07 10:11:11 +02:00