You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This example is from Xamarin, but since no updates will be made to it afaik I'm posting this here, feel free to delete if you already implemented something of the sort to MAUI, I'm still using Xamarin so I'm not aware of any MAUI changes.
Currently if you change the FontFamily (of a label for example) to a custom font added through AssemblyInfo.cs
[assembly: ExportFont("Tahoma.ttf", Alias = "Tahoma")]
[assembly: ExportFont("Tahoma-Bold.ttf", Alias = "TahomaBold")]
FontAttributes property for that label is basically useless, does not change anything, if you want to make that label use bold Tahoma you must currently change the FontFamily to the Bold Variant of that font.
My suggestion is to allow the below to happen
[assembly: ExportFont("Tahoma.ttc", Alias = "Tahoma", Attribute = "Regular")]
[assembly: ExportFont("Tahoma-Bold.ttc", Alias = "Tahoma", Attribute = "Bold")]
The Alias is the same, but we've added an attribute type to the font. When adding the fontfamily to a label, the fontattributes will now be hooked up to the attribute.
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
Uh oh!
There was an error while loading. Please reload this page.
-
This example is from Xamarin, but since no updates will be made to it afaik I'm posting this here, feel free to delete if you already implemented something of the sort to MAUI, I'm still using Xamarin so I'm not aware of any MAUI changes.
Currently if you change the FontFamily (of a label for example) to a custom font added through AssemblyInfo.cs
FontAttributes property for that label is basically useless, does not change anything, if you want to make that label use bold Tahoma you must currently change the FontFamily to the Bold Variant of that font.
My suggestion is to allow the below to happen
The Alias is the same, but we've added an attribute type to the font. When adding the fontfamily to a label, the fontattributes will now be hooked up to the attribute.
Beta Was this translation helpful? Give feedback.
All reactions