Declined
Last Updated: 26 Jul 2024 17:20 by ADMIN
Stephen
Created on: 26 Jul 2024 15:47
Category: UI for .NET MAUI
Type: Bug Report
0
Error loading font 'Assets/Fonts/Segoe UI.ttf' and 'Assets/Fonts/Segoe UI.otf'

I am in the process of preparing my product for alpha release and I am scrubbing my log files for anything that needs to be cleaned up prior to release. I am seeing two message in my log file that I cannot pinpoint in my code so I am suspecting it is coming from your code. I use NLog to log errors so I format Errors differently than general errors. I am seeing the following two errors being logged on app startup:


----------------------------------
2024-07-26 07:28:06.9283 ERROR 
  Call site:         App.LogException
  Method name:       MobyClient.WinUI.App.LogException
  Line:              0
  Exception Type:    System.ArgumentException
  Exception Message: The parameter is incorrect.

Assets/Fonts/Segoe UI.otf is not a valid absolute URI.
  Stack Trace:       at WinRT.ExceptionHelpers.<ThrowExceptionForHR>g__Throw|39_0(Int32 hr)
  Additional Info:   An error occurred
----------------------------------

and


----------------------------------
2024-07-26 07:28:06.8891 ERROR 
  Call site:         App.LogException
  Method name:       MobyClient.WinUI.App.LogException
  Line:              0
  Exception Type:    System.ArgumentException
  Exception Message: The parameter is incorrect.

Assets/Fonts/Segoe UI.ttf is not a valid absolute URI.
  Stack Trace:       at WinRT.ExceptionHelpers.<ThrowExceptionForHR>g__Throw|39_0(Int32 hr)
  Additional Info:   An error occurred
----------------------------------

In my MauiProgram.cd file, I load many fonts:


		_ = builder
			.UseMauiApp<App> ()
			.UseTelerik ()
			.ConfigureFonts (fonts => {
				_ = fonts.AddFont ("FontAwesome6Brands-Regular-400.otf", "FaBrands");
				_ = fonts.AddFont ("FontAwesome6Duotone-Solid-900.otf", "FaDuotone");
				_ = fonts.AddFont ("FontAwesome6Pro-Light-300.otf", "FaLight");
				_ = fonts.AddFont ("FontAwesome6Pro-Regular-400.otf", "FaRegular");
				_ = fonts.AddFont ("FontAwesome6Pro-Solid-900.otf", "FaSolid");
				_ = fonts.AddFont ("FontAwesome6Pro-Thin-100.otf", "FaThin");
				_ = fonts.AddFont ("OpenSans-Regular.ttf", "OpenSansRegular");
				_ = fonts.AddFont ("OpenSans-Semibold.ttf", "OpenSansSemibold");
				_ = fonts.AddFont ("Poppins-Black.otf", "PoppinsBlack");
				_ = fonts.AddFont ("Poppins-BlackItalic.otf", "PoppinsBlackItalic");
				_ = fonts.AddFont ("Poppins-Bold.otf", "PoppinsBold");
				_ = fonts.AddFont ("Poppins-BoldItalic.otf", "PoppinsBoldItalic");
				_ = fonts.AddFont ("Poppins-ExtraBold.otf", "PoppinsExtraBold");
				_ = fonts.AddFont ("Poppins-ExtraBoldItalic.otf", "PoppinsExtraBoldItalic");
				_ = fonts.AddFont ("Poppins-ExtraLight.otf", "PoppinsExtraLight");
				_ = fonts.AddFont ("Poppins-ExtraLightItalic.otf", "PoppinsExtraLightItalic");
				_ = fonts.AddFont ("Poppins-Italic.otf", "PoppinsItalic");
				_ = fonts.AddFont ("Poppins-Light.otf", "PoppinsLight");
				_ = fonts.AddFont ("Poppins-LightItalic.otf", "PoppinsLightItalic");
				_ = fonts.AddFont ("Poppins-Medium.otf", "PoppinsMedium");
				_ = fonts.AddFont ("Poppins-MediumItalic.otf", "PoppinsMediumItalic");
				_ = fonts.AddFont ("Poppins-Regular.otf", "PoppinsRegular");
				_ = fonts.AddFont ("Poppins-SemiBold.otf", "PoppinsSemiBold");
				_ = fonts.AddFont ("Poppins-SemiBoldItalic.otf", "PoppinsSemiBoldItalic");
				_ = fonts.AddFont ("Poppins-Thin.otf", "PoppinsThin");
				_ = fonts.AddFont ("Poppins-ThinItalic.otf", "PoppinsThinItalic");
				_ = fonts.AddFont ("Segoe-Ui.ttf", "SegoeUi");
				_ = fonts.AddFont ("Segoe-Ui-Bold.ttf", "SegoeUiBold");
				_ = fonts.AddFont ("Segoe-Ui-Regular.ttf", "SegoeUiRegular");
				_ = fonts.AddFont ("Segoe-Ui-Semibold.ttf", "SegoeUiSemibold");
				_ = fonts.AddFont ("Segoe-Ui-Semilight.ttf", "SegoeUiSemilight");
			})
			.ConfigureMobyApplication ();

As you can see, 'Assets/Fonts/Segoe UI.ttf' or 'Assets/Fonts/Segoe UI.otf' is a font I am loading. In fact, all of the 'Segoe' font names use a dash '-' instead of a space in the file name. Also, I only load 'ttf' fonts and not 'otf' fonts for Seqoe fonts. Telerik controls are the only non-standard controls I am using so I am suspecting this font name is being loaded by your controls somehow. Can you please confirm this?

Also, when I went to report this incident, I noticed that you had requested input from me on previous issues I have raised, but I never received any email from you requesting this information. Since I rarely log into this website for anything, I don't know how you expect people to answer your questions if they are not made more visible. Is there a way to subscribe to an issue so I see all updates? I looked over the complete set of items I can add to this issue and none of them seem to be related to answering questions from you. It would be helpful for you to send any and all updates on any issues that have been logged. I just scanned my entire set of email folders and other than messages from your sales department, no other messages were found. Just sayin'...

3 comments
ADMIN
Lance | Senior Manager Technical Support
Posted on: 26 Jul 2024 17:20

Hi Stephen,

I didn't see your latest reply until I sent mine. Thank you for the updated output. Please note that last that one is a warning, not an error. It may or may not be relevant, depending on the circumstances.

If you can confirm you are building an msix-packaged WinUI3 app, and are not seeing the TelerikFonts at runtime, please open a Support Ticket so that we can investigate your specific situation. 

We do not have the same problem when deploying and publishing our apps, which also use the same font. However, we are publishing as a msix package, which likely goes to the same fundamental issue again.

Regardless, it would be ideal to have such a test project that reproduces the problems so we can come to a definitive conclusion. Then, the team can assist you further there. The Feedback Portal is not the best place to get that assistance if you want timely help.

Regards,
Lance | Senior Manager Technical Support
Progress Telerik

Love the Telerik and Kendo UI products and believe more people should try them? Invite a fellow developer to become a Progress customer and each of you can get a $50 Amazon gift voucher.

ADMIN
Lance | Senior Manager Technical Support
Posted on: 26 Jul 2024 17:13

Hello Stephen,

Thank you for sharing the logs, these were very illuminating. Are you deploying an unpackages app to something like Windows Server? This looks like it is, due to choosing to go with an unpackaged route. In which case you do not get the benefits of packaging and known URIs.

This is a known concern when using the Microsoft Windows App SDK with unpackage app type in a .NET MAUI application. The error shows this URI being used: "Assets/Fonts/Segoe UI.otf is not a valid absolute URI.". However, the URI is supposed/expected to be "ms-appx:///Assets/Fonts/Segoe UI.otf", so such an error is expected.

    Please understand that although missing assets would affect your use of them in a Telerik control, missing assets in the WinAppSDK are not related to Telerik UI for Maui controls themselves.  Please review the following items.

    This is something we do not have any control over. Thus, I need to close this Bug Report as Declined/Unrelated and outside the scope of support.

    Further Assistance with Windows App SDK

    At this point, I need to refer you to discuss this with the .NET MAUI team or WinAppSDK team (I'm not sure who would be responsible for this area, most likely .NET MAUI because they have put the feedback on the backlog.

    If this were my app, my first steps would be to make sure I have that font file in my Resources/Fonts folder, the file's Build Action is set to "Copy always" and confirm the font works in the simplest manner possible after deployment.

    You mentioned that you think the problem was due to the space in path/name. I believe this is not the case, because the error would have only had the partial file name (either the front or rear part) in the error. We have not observed any issue when there is a space in the font family name. Additionally, I use Font Awesome all the time and it has spaces.

    Ultimately, none of these things will address the missing ms-app prefix part of the file path when using an unpackaged application. Unpackaged explicitly means there is no packaged assets path. For solutions/approaches, you'll need to review how other devs are handling this when they are choosing to unpackaged route.

    Getting the Most From Technical Support

    Regarding your comment about your previous interactions, I looked into your account history. I noticed you tend to open forum posts, these do not carry any SLO and can take much longer to come to a resolution. So I recommend that you take advantage of your support package for these initial investigations that are time sensitive or require some definitive outcome.

    To avoid miscommunication in the future, here are your options. If you want back and forth help with technical communication, then please use the channels for this:

    1. Technical Support https://www.telerik.com/account/support-center/contact-us (choose "Technical Support")
      • This is professional technical help, directly from the UI for Maui Team, with a dedicated SLO
    2. Forums https://www.telerik.com/forums/maui 
      • This is community-based help with no guaranteed reply or SLO (but we try our best to answer in a reasonable timeframe).
      • Use this if your problem is not time-sensitive, or if you intentionally want to have a conversation with the community
    3. Feedback Portal (where you are now)
      • This is for logging and tracking work items, it is not designed a 1:1 technical support channel. The turnaround time for a reply is much longer than any technical support conversation.

    I believe you should always be using #1, so you can get prompt assistance for the underlying issue in a fast and 1:1 manner. I see you have a license for this type of help but have not used it. Then, if there is a need for us to open an official Bug Report or Feature Request as part of that investigation, we will go and do that for you (so you don't have to duplicate your efforts).

    Next Steps for Telerik-Specific

    If you are sure this is a Telerik-only issue, and are able to confirm this problems happens in:

    • A packaged WinUI3 app
    • Only affects a Telerik UI for Maui control

    Please put the affected code into an isolated test project and zip up that project. Then, take the following steps:

    1. Go to https://www.telerik.com/account/support-center/contact-us 
    2. Select "Technical Support" and make the next couple selections for UI for Maui
    3. Attach that ZIP reproducible project to the ticket
    4. In the body of the message, explain steps to reproduce

    I will escalate such a ticket to the senior engineers who are most familiar with how the Font system works in .NET MAUI to investigate further.

    Wrapping Up

    I hope I was able to shine some light on the problem and point you in the right direction. If I were to leave you with any applicable advice, here are some of my thoughts:

    • Windows comes with Segoe UI, there's no need to embed it unless you're intentionally using it cross platform
    • The capitalization and spelling of the Font's name is inaccurate. On Windows this won't matter, but it will affect you on case-sensitive platforms. Please review the font family name, font name and file names to ensure they're accurate (you can use the Font Manager app on Windows)
    • Make sure any font files you're including in the project have the Build Action set to Copy always (or copy if newer), just to ensure these are being included in the build output. The MauiFont feature in csproj is supposed to handle this, but I can't comment on how this works.

    Thank you and good luck.

    Regards,
    Lance | Senior Manager Technical Support
    Progress Telerik

    Love the Telerik and Kendo UI products and believe more people should try them? Invite a fellow developer to become a Progress customer and each of you can get a $50 Amazon gift voucher.

    Stephen
    Posted on: 26 Jul 2024 16:07

    To prove my point, I just looked at the latest log file and found this:

    ----------------------------------
    2024-07-26 08:59:57.1118 WARN  
      Call site:         FontRegistrar.GetFont
      Method name:       Microsoft.Maui.FontRegistrar.GetFont
      Line:              0
      Exception Type:    System.InvalidOperationException
      Exception Message: Operation is not valid due to the current state of the object.
      Stack Trace:       at WinRT.ExceptionHelpers.<ThrowExceptionForHR>g__Throw|39_0(Int32 hr)
       at ABI.Windows.Storage.IApplicationDataStaticsMethods.get_Current(IObjectReference _obj)
       at Windows.Storage.ApplicationData.get_Current()
       at Microsoft.Maui.EmbeddedFontLoader.LoadFont(EmbeddedFont font)
       at Microsoft.Maui.FontRegistrar.LoadEmbeddedFont(String cacheKey, String filename, String alias, Stream stream)
       at Microsoft.Maui.FontRegistrar.GetFont(String font)
      Additional Info:   Unable to load font 'TelerikFont'.
    ----------------------------------

    Finding this recent post was not easy. Your website does not make finding ALL of my issues in one list...