adding custom font in .net maui does nothing on android

Kai Winters 0 Reputation points
2023-01-16T02:27:26.56+00:00

Also my font is not showing on my label, that is 100% not a chewy font, however its in there like it is supposed to:

 
public static MauiApp CreateMauiApp()
{
        var builder = MauiApp.CreateBuilder();
        builder
            .UseMauiApp<App>()
            .ConfigureFonts(fonts =>
            {
                fonts.AddFont("Chewy-Regular.tff", "Chewy");
                fonts.AddFont("OpenSans-Regular.ttf", "OpenSansRegular");
                fonts.AddFont("OpenSans-Semibold.ttf", "OpenSansSemibold");
                fonts.AddFont("Quicksand-Regular.tff", "QuicksandRegular");
                fonts.AddFont("Quicksand-Light.tff", "QuicksandLight");
                fonts.AddFont("Quicksand-Medium.tff", "QuicksandMedium");
                fonts.AddFont("Quicksand-SemiBold.tff", "QuicksandSemiBold");
                fonts.AddFont("Quicksand-Bold.tff", "QuicksandBold");
            });
        return builder.Build();
    }

d5af1ac36943c7d275068ffa9d263ccd

it all looks right to me so Idk why its not showing up?

my quicksand font also doesnt show up, and this is supposed to show chewy in the image but its still opensans.

7fed4a8d35a7d06ee5c596fcf7270643

.NET MAUI
.NET MAUI
A Microsoft open-source framework for building native device applications spanning mobile, tablet, and desktop.
912 questions
XAML
XAML
A language based on Extensible Markup Language (XML) that enables developers to specify a hierarchy of objects with a set of properties and logic.
560 questions
{count} votes

1 answer

Sort by: Most helpful
  1. Leon Lu (Shanghai Wicresoft Co,.Ltd.) 41,831 Reputation points Microsoft Employee
    2023-01-17T01:47:41.77+00:00

    Hello,

    You set the wrong font extension, your font extension should be ttf , but you set tff in fonts.AddFont("Chewy-Regular.tff", "Chewy");, Please change it to fonts.AddFont("Chewy-Regular.ttf", "Chewy");

    Best Regards,

    Leon Lu


    If the answer is the right solution, please click "Accept Answer" and kindly upvote it. If you have extra questions about this answer, please click "Comment".

    Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.

    No comments