Noesis and FontAwesome
Posted: 17 Dec 2018, 10:07
Hey,
I'm trying to use FontAwesome in my noesis project. I put it into our theme like this:
Then I'm trying to use it in a label like this:
At first I wasn't sure if that syntax was even going to find the font file but it does.
But then it fails making a font family out of that anyway.
We're getting the following exception:
I used the ttf file from: https://github.com/FortAwesome/Font-Awe ... id-900.ttf
What am I doing wrong?
I'm trying to use FontAwesome in my noesis project. I put it into our theme like this:
Code: Select all
<ResourceDictionary
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml">
<FontFamily x:Key="FontAwesome">UIAssets/Fonts/FontAwesome.ttf#FontAwesome</FontFamily>
</ResourceDictionary>
Code: Select all
<Label FontFamily="#FontAwesome" FontSize="{Binding TitleFontSize, FallbackValue=48}">Play</Label>
But then it fails making a font family out of that anyway.
We're getting the following exception:
Code: Select all
NoesisException: Assets/MyTheme.xaml(38): Can't convert 'UIAssets/Fonts/FontAwesome.ttf#FontAwesome' into a 'FontFamily' object.
Rethrow as NoesisException
Noesis.Error.Check () (at Assets/NoesisGUI/Plugins/API/Core/NoesisError.cs:17)
Noesis.GUI.Noesis_LoadComponent_ (System.Runtime.InteropServices.HandleRef component, System.String xaml) (at Assets/NoesisGUI/Plugins/API/Core/NoesisGUI.cs:282)
Noesis.GUI.LoadComponent (System.Object component, System.String xaml) (at Assets/NoesisGUI/Plugins/API/Core/NoesisGUI.cs:135)
[...]
(wrapper dynamic-method) System.Object.lambda_method(System.Runtime.CompilerServices.Closure)
Noesis.Extend.CreateInstance (System.IntPtr nativeType, System.IntPtr cPtr) (at Assets/NoesisGUI/Plugins/API/Core/NoesisExtend.cs:3933)
Rethrow as NoesisException
Noesis.Error.Check () (at Assets/NoesisGUI/Plugins/API/Core/NoesisError.cs:17)
Noesis.GUI.Noesis_LoadXaml_ (System.String xaml) (at Assets/NoesisGUI/Plugins/API/Core/NoesisGUI.cs:275)
Noesis.GUI.LoadXaml (System.String xaml) (at Assets/NoesisGUI/Plugins/API/Core/NoesisGUI.cs:125)
NoesisXaml.Load () (at Assets/NoesisGUI/Plugins/NoesisXaml.cs:31)
NoesisView.LoadXaml (System.Boolean force) (at Assets/NoesisGUI/Plugins/NoesisView.cs:333)
NoesisView.OnEnable () (at Assets/NoesisGUI/Plugins/NoesisView.cs:398)
What am I doing wrong?