Using Font Icons in Telerik UI for .NET MAUI
Environment
Version | Product | Author |
---|---|---|
6.7.0 | Telerik UI for .NET MAUI Font Icons | Dobrinka Yordanova |
Description
How can I use font icons in Telerik UI for .NET MAUI, and where can I find the complete list of available font icons?
Solution
To use font icons in your Telerik UI for .NET MAUI application, follow these steps:
Download the font file.
Add the font to your project by placing it in the
Resources/Fonts
folder.Register the font in the
MauiProgram.cs
file:
.ConfigureFonts(fonts =>
{
fonts.AddFont("OpenSans-Regular.ttf", "OpenSansRegular");
fonts.AddFont("OpenSans-Semibold.ttf", "OpenSansSemibold");
fonts.AddFont("telerikfontexamples.ttf", "TelerikFontExamples");
});
- Consume the font icon in your XAML:
<Label Text="" FontFamily="TelerikFontExamples" FontSize="Micro" FontAttributes="Bold" TextColor="Black" />
To find the complete list of available font icons, you can use an extension such as the iconfont-preview extension for Visual Studio Code.