In the screenshot tests this works by setting SLINT_DEFAULT_FONT to
pointer to a directory, instead of a file. We then load all fonts in
that directory and consider their families the default unless a family
is specified. This way for "Noto Sans" a regular as well as an italic
version is registered in fontdb and returned in the list of font
fallback ids. embed_glyphs in the compiler then embeds those variants
and we find them at run-time.
Change the font selection in the software renderer to always prefer
embedded bitmap fonts. This way when running `cargo test -p
test-driver-screenshots` the pixel fonts are used (as before this patch)
as well as in the CI, when all features are enabled (including
"systemfonts").
This originates from #2141
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.
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.
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).