yokaichan
Topic Author
Posts: 3
Joined: 13 Mar 2017, 15:39

Fontawesome, Font not found until it's selected

10 Jun 2020, 18:42

Hello,

I start a new project in which I use Fontawesome to display some icons.

I add the followinf resource into my MainWindow.xaml (because in the App.xaml the StaticResource is not found):
<ResourceDictionary>
<FontFamily x:Key="FontAwesome">../Fonts/fa-solid-900.ttf#Font Awesome 5 Free</FontFamily>
</ResourceDictionary>
When I launch the scene , the font is not found, and the scene don't display the right icon.
But if I click on the "fa-solid-900.asset" to select it into the Unity UI, then launch the scene, it shows me the right icon. (but the error "not found" still here)
 
User avatar
sfernandez
Site Admin
Posts: 2983
Joined: 22 Dec 2011, 19:20

Re: Fontawesome, Font not found until it's selected

10 Jun 2020, 19:05

One question, if you select MainWindow asset in the editor, does it show the font as a dependency in the inspector?
 
yokaichan
Topic Author
Posts: 3
Joined: 13 Mar 2017, 15:39

Re: Fontawesome, Font not found until it's selected

10 Jun 2020, 19:12

No, all dependencies are empty
 
User avatar
sfernandez
Site Admin
Posts: 2983
Joined: 22 Dec 2011, 19:20

Re: Fontawesome, Font not found until it's selected

10 Jun 2020, 19:31

Ok, it seems there is a problem with the dependencies when the font path includes the ttf file.
Could you please try with the following:
<FontFamily x:Key="FontAwesome">../Fonts/#Font Awesome 5 Free</FontFamily>
 
yokaichan
Topic Author
Posts: 3
Joined: 13 Mar 2017, 15:39

Re: Fontawesome, Font not found until it's selected

10 Jun 2020, 19:34

Thank you very much... it works perfectly.

Who is online

Users browsing this forum: Ahrefs [Bot], Bing [Bot], Google [Bot] and 66 guests