Skip to content

Log - Missing Fonts report #28502

Description

@danies8

Description

Hi,

  1. I got missing font OpenSansRegular.ttf although i removed them from project entirely and not appear in C:\Windows\Fonts..
  2. I got missing font Segoe UI.ttf although it exist in my computer in C:\Windows\Fonts.
    Image

Steps to Reproduce

1.Create new MAUI app.
2. Comment
.ConfigureFonts(fonts =>
{
//fonts.AddFont("OpenSans-Regular.ttf", "OpenSansRegular");
//fonts.AddFont("OpenSans-Semibold.ttf", "OpenSansSemibold");
and remove these fonts from Resource/Fonts folder.

  1. publish the maui as exe:

  2. dotnet publish -f net9.0-windows10.0.19041.0 -c Release -p:WindowsPackageType=None -p:WindowsAppSDKSelfContained=true
    -p:RuntimeIdentifierOverride=win10-x64

  3. I got this results in LOG:
    2025-03-19 12:11:52,454 [1] ERROR Microsoft.Maui.FontManager - Error loading font 'Assets/Fonts/OpenSansRegular.ttf'.
    System.InvalidOperationException: This operation is not supported for a relative URI.
    at System.Uri.get_LocalPath()
    at Microsoft.Maui.FontManager.FindFontFamilyName(String fontFile)
    2025-03-19 12:11:52,461 [1] ERROR Microsoft.Maui.FontManager - Error loading font 'Assets/Fonts/OpenSansRegular.otf'.
    System.InvalidOperationException: This operation is not supported for a relative URI.
    at System.Uri.get_LocalPath()
    at Microsoft.Maui.FontManager.FindFontFamilyName(String fontFile)
    2025-03-19 12:12:10,912 [1] ERROR Microsoft.Maui.FontManager - Error loading font 'Assets/Fonts/Segoe UI.ttf'.
    System.InvalidOperationException: This operation is not supported for a relative URI.
    at System.Uri.get_LocalPath()
    at Microsoft.Maui.FontManager.FindFontFamilyName(String fontFile)
    2025-03-19 12:12:10,913 [1] ERROR Microsoft.Maui.FontManager - Error loading font 'Assets/Fonts/Segoe UI.otf'.
    System.InvalidOperationException: This operation is not supported for a relative URI.
    at System.Uri.get_LocalPath()
    at Microsoft.Maui.FontManager.FindFontFamilyName(String fontFile)

Link to public reproduction project repository

No response

Version with bug

9.0.30 SR3

Is this a regression from previous behavior?

Not sure, did not test other versions

Last version that worked well

Unknown/Other

Affected platforms

Windows

Affected platform versions

....

Did you find any workaround?

NO

Relevant log output

I reported above.

Metadata

Metadata

Assignees

No one assigned

    Labels

    area-fontsCustom fonts and Font related API'splatform/windowss/triagedIssue has been revieweds/verifiedVerified / Reproducible Issue ready for Engineering Triaget/bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions