How do you add and use a custom font in MAUI?
Short answer
Place the .ttf/.otf in Resources/Fonts (MauiFont build action), register it with an alias in ConfigureFonts, then reference the alias via FontFamily. This works consistently across platforms without per-platform font registration.
Advertisement
AModel answer
Place the .ttf/.otf in Resources/Fonts (MauiFont build action), register it with an alias in ConfigureFonts, then reference the alias via FontFamily. This works consistently across platforms without per-platform font registration.
builder.ConfigureFonts(f =>
f.AddFont("Inter-Regular.ttf", "Inter"));
// XAML
<Label Text="Hello" FontFamily="Inter" />Real-world example
A brand typeface is registered once and applied everywhere via the FontFamily alias.
Likely follow-ups
- Where do fonts go? | Do you need per-platform registration?
Related topics