Font missing after update to 0.12.1

Hey!
I wanted to update one of my old projects to the newest version of iced. After fixing all issues in my code, the application seems to miss all the fonts. I then recompiled with the last version of iced and the application look as before. Does anyone have experience with that issue?

Same here: after I upgraded chars were rendered as boxes. Not sure if it’s iced or my system.
Funnily if I run an iced example it works fine, if I copy the code out of the iced repository and add iced as a dependency it doesn’t.

Any suggestion on how to debug it?

I can also confirm that I could reproduce the issue not only with my project, but also with the “game-of-life”-example from the repository.

Bisecting the iced repository, for me problem appeared with this commit:

commit 86b877517feb15b2155c6cfef29246a3f281c8ae
Author: Héctor Ramón Jiménez hector@hecrj.dev 2023-10-27 03:21:40
Committer: Héctor Ramón Jiménez hector@hecrj.dev 2023-10-27 03:24:06
Parent: f1b1344d59fa7354615f560bd25ed01ad0c9f865 (Run cargo update before cargo audit in audit workflow)
Child: a00ebcde3d698bc6b59a7a258e91c3612a6faaaf (Remove unnecessary into_iter call in iced_graphics)
Branches: master, origin/0.12, origin/HEAD, origin/master

Update wgpu to 0.18 and cosmic-text to 0.10

I can confirm that I’ve been seeing this same issue since 0.12 on PopOS. It looks like the default sans-serif font family (which Iced appears to default to) doesn’t load in properly. If you set the font family to something else it works. I recently tested this on a VM with a fresh install of PopOS because I wasn’t sure if it was an issue with my system’s fonts or not and the issue still shows up. Based on my initial search through the source code, I think that cosmic text is supposed to default to Fira Sans for its default sans-serif font, but I’m not sure. Either way, I can set the font family specifically to Fira Sans and it works.

thanks @pyroraptor07 ! that worked for me too.

I used a local copy of cosmic-text as dependency so that I could experiment a bit and the commit that causes this behaviour is

where the fonts returned by fontdb are used. It seems though that only opentype fonts are rendered correctly and I think at some point I installed some truetype fonts and fontdb returns one of those.

Before that change the font was set to Fira Sans, which I do not have and therefore cosmic-text would fallback to Noto Sans (opentype).

I tried a couple of fonts to test the assumption and seems to be correct.