Open jt-github opened 6 years ago
surprised that something so common like FontAwesome isn't even being addressed
same issue I'm having
I am also having this issue. Everything works fine on iOS, but as soon as a different font is used on Android, it's lights out. I am trying to use Roboto
me too...same issue with FontAwesome...
Hi, I am also facing this exact same issue. Updated to gorilla version 1.2.2. Not seeing any difference. Please help!
@jt-github
Works fine for both platforms. I use font awesome 5 free.
For Android add the ttf files to the "Assets" folder, build action should be AndroidAsset.
fa-brands-400.ttf fa-regular-400.ttf fa-solid-900.ttf
Use these strings in your project. I put mine in the App.xaml resources
`
<OnPlatform x:TypeArguments="x:String" x:Key="FontFontAwesomeBrands" iOS="FontAwesome5BrandsRegular" Android="fa-brands-400.ttf#FontAwesome5BrandsRegular"></OnPlatform>`
Example:
<Label Text="" FontFamily="{StaticResource FontFontAwesomeBrands}"></Label>
If I follow the standard Xamarin Forms instructions for using a custom font on Android: https://developer.xamarin.com/guides/xamarin-forms/user-interface/text/fonts/#Using_a_Custom_Font
And run an old-fashioned debug session on my emulator, the font renders as expected. When I try to preview the XAML page in Gorilla Player, it immediately crashes with the following error in the logs:
There is a mention of custom fonts in the Gorilla SDK documentation, but only a single mention without any details or examples. Custom fonts are built into Xamarin Forms, so I wouldn't think you'd need the SDK just to preview fonts. That being said, running my app using the SDK works fine and the font renders as expected!
I added FontAwesome.otf to my Assets folder, then created the following simple little label:
I'd attach a project, but this is easily reproduced.
If the regular Gorilla Player currently cannot render custom fonts, then it should definitely not cause a crash (with no helpful error message) but rather display the old "You need the SDK, Bro!" message instead. OK, maybe that's not the exact message, but you know what I mean.