Did anyone manage to load custom font in Compose w...
# compose-web
m
Did anyone manage to load custom font in Compose web (canvas), I was able to load the fonts with some workarounds (The font family is null at the beginning then I initialize it from a LaunchedEffect after successfully loading the fonts and creating the font family), and when I use the font family in a Text composable I get an error.
IllegalStateException: Could not load font
, the error appears only when I use that font family in a Text composable.
b
I use custom fonts in my project, and using the same approach as you (loading the font in a LaunchedEffect) Here is the theme composable and the implementation on wasm using compose-multiplatform resources to load a font (resource takes in the path to the font)
thank you color 1
m
Thanks I will check it
I still have the same issue. It appears that the problem is in the font that I am using. It's working fine on desktop but not in web. I'm not sure why. When I tried a different font, it worked fine.
a
Exploring same.
s