Unity Default Font and Font Weight
Posted: 11 Jul 2023, 23:17
Hi all 🙂,
I am not sure if this is user error or not, but when I try to configure a default, what I see is not my expected results.
If you set the Noesis.settings.asset default font entry to, for example, Lato-heavy, I would assume that I can omit the FontFamily="Fonts/#Lato" from a TextBlock element, but still have control over the FontWeight. This isn't what happens for me. If I don't specify the FontFamily and only the FontWeight, it will use the font family from the asset I selected in Unity to be the default, and ignore what I've set as the FontWeight and use whatever is present in the default font asset I set.
Just as an example demo, this will not render in Unity as a Light font variant, but it will use the Heavy variant.
I understand that as the fonts are imported, the custom importer will split it into a Family, Weight, Style and Stretch. But why should my explicitly set FontWeight attribute not override what I've set in the Noesis.settings file? Is it not the more immediate attribute that trumps the default values in the settings file?
Thanks!
David
I am not sure if this is user error or not, but when I try to configure a default, what I see is not my expected results.
If you set the Noesis.settings.asset default font entry to, for example, Lato-heavy, I would assume that I can omit the FontFamily="Fonts/#Lato" from a TextBlock element, but still have control over the FontWeight. This isn't what happens for me. If I don't specify the FontFamily and only the FontWeight, it will use the font family from the asset I selected in Unity to be the default, and ignore what I've set as the FontWeight and use whatever is present in the default font asset I set.
Just as an example demo, this will not render in Unity as a Light font variant, but it will use the Heavy variant.
Code: Select all
<TextBlock Text="Testing" FontWeight="Light"/> <!-- This will be Lato, but it will be heavy, since the default font is Lato-heavy.ttf -->
<TextBlock Text="Testing" FontFamily="Fonts/#Lato" FontWeight="Light"/> <!-- This will be Light -->
Thanks!
David