slint
slint copied to clipboard
Misleading compilation error when default font cannot be embedded when embedding glyphs
When building with slint_build::EmbedResourcesKind::EmbedForSoftwareRenderer, we get misleading compilation error when the default font don't exist.
To reproduce, edit the carousel_demo.slint and change the default font binding:
default-font-family: "NOT EXIST";
Then you get the error:
error: could not find font that provides specified family, falling back to Sans-Serif
--> /home/olivier/slint/examples/carousel/ui/carousel_demo.slint:22:26
|
22 | default-font-family: "NOT EXIST";
|
It says it is falling back, but it doesn't since it errors out.
The error is even worse if the invalid font comes from the style. Eg, modify the material-base/std-widget-impl.slint to change the default font
out property <string> default-font-family: "NOT EXIST";
and remove the default-font-family property from the window. Now we get:
error: internal error: fontdb could not determine a default font for sans-serif
--> /home/olivier/slint/examples/carousel/ui/carousel_demo.slint:8:38
|
8 | export component MainWindow inherits Window {
| ^
I am also having a similar issue on FreeBSD... Anyone have a fix yet? I used the default template with cargo-generate. It seemed to build fine, but when I ran cargo run
I got the error you see below.
Similar issue indeed. Do you have libfontconfig on your system installed?
Similar issue indeed. Do you have libfontconfig on your system installed?
Yes, it was installed. That was the first thing I thought to check. Thanks for the quick response!
Ok - next thing to check :). What does fc-match sans-serif
print?
Ok - next thing to check :). What does
fc-match sans-serif
print?
It prints NotoSans-Regular.ttf: "Noto Sans" "Regular"