C#C
C#2y ago
Emmanuel

.NET Maui font problems

Hi,
I am building an app in .Net Maui. I use custom fonts. They worked very well and suddenly, the program started to crash, saying the fonts uri was not correct. I haven't moved anything. I opened a similar project and it worked well, same configuration. I simply do lot get it.

        public static MauiApp CreateMauiApp()
        {
            var builder = MauiApp.CreateBuilder();
            builder
                .UseMauiApp<App>()
                .ConfigureFonts(fonts =>
                {
                    fonts.AddFont("OpenSans-Regular.ttf", "OpenSansRegular");
                    fonts.AddFont("OpenSans-Semibold.ttf", "OpenSansSemibold");
                    fonts.AddFont("BLOOMINGS.OTF", "Bloomings");
                    fonts.AddFont("FUTURA BOOK FONT.TTF", "FuturaBook");
                    fonts.AddFont("FUTURA BOOK ITALIC FONT.TTF", "FuturaBookItalic");
                });

#if DEBUG
            builder.Logging.AddDebug();
#endif
          return builder.Build();
        }
    }

<Entry
Grid.Column="2"
x:Name="Search"
Placeholder="Search"
PlaceholderColor="#BFBFBF"
BackgroundColor="#FFFFFF"
FontSize="11"
FontFamily="FUTURA BOOK FONT"
TextColor="#383838"
VerticalTextAlignment="Start"
    HorizontalTextAlignment="End"
HorizontalOptions="Fill"

VerticalOptions="Center"
WidthRequest="90"
/>
Was this page helpful?
.NET Maui font problems - C#