-
Notifications
You must be signed in to change notification settings - Fork 1.8k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Windows FontImageSourceService assumes MSIX packaging #15802
Comments
I assume this would go in line with #10564, @mattleibow? |
@drasticactions Thanks for pointing that out. This one might also be related to #9104 |
Now I understand what's going on a bit more, I believe this is actually a dupe of #9104. i.e. The ms-appx URI is intentional and the failure was also due to an issue in WinUI3/Win2D. Nonetheless, I still observe the issue on a local build of MAUI release/7.0.2xxsr7 even though all the PRs have been merged there. @mattleibow perhaps this should be closed in favour of reopening #9104? |
I spoke to soon. The FontManager does manage to load the fonts OK, which is what #9104 is about, but FontImageSource is still broken, which my repro project was also testing. So, even though the initial error is resolved on release/7.0.2xxsr7, #9104 is not sufficient to resolve all the problems constructing CanvasTextLayouts:
|
We've added this issue to our backlog, and we will work to address it as time and resources allow. If you have any additional information or questions about this issue, please leave a comment. For additional info about issue management, please read our Triage Process. |
Verified this on Visual Studio Enterprise 17.7.0 Preview 5.0. Repro on Windows 11 .NET 8.0 with below Project: |
I had a look and I can't get the FontImageSource implementation to load fonts by file or in unpackaged apps (which load by file). The exception says:
I will open a bug in Win2D |
Opened this one and will follow up with that team: microsoft/Win2D#941 |
I have been seeing this error for months. I am also doing an unpackaged deployment, but I am not seeing the same exact error that @jeremy-visionaid reported... but, very similar. I have been seeing (formatting done by NLog):
I am not loading this particular font, nor is it listed anywhere in my solution. Here is the section where I load fonts:
All of these fonts are included in my Resources\Fonts folder, so I am confused as to where the 'Assets/Fonts/Segoe UI.ttf' is coming from. In my .csproj file there is this for fonts:
but that is a standard project file entry. I remember during a preview release that the splash screen was defined like '.../Assets/...' and there were instructions in the release notes on how to get around that issue. The code that is throwing this error is located in Microsoft.Maui.FontManager inside the FindFontFamilyName method. There is a constant for
If this is truly the case, the call to As a rule, I do not like errors in the error log that I have no control over. If there is a way to stop this error, I'd love to know!! |
met same issue, my product heavy depend on fontawesome. |
Facing the same issue here as well AathifMahir/MauiIcons#79 |
Is there perhaps a workaround for this issue? |
@GuidoNeele I had to use SVG based icons instead |
It doesn't look like there is a huge amount of activity on that repository (and there are bugs affecting WinUI open from 2017). Is there anything that can be done to prioritise that issue? I wouldn't normally ask this but I see this issue is marked as a "p/1" and it feels like it might be a few .NET versions away from being resolved. |
@BurkusCat I'm not sure how much you can tell about what's going on via GitHub. Seems like most of the work for WinUI & Win2D take part behind closed doors. You can see the work for a similar issue was tracked via a different system: microsoft/Win2D#891 I was watching WinUI 3 for a year waiting for the release blockers to be fixed before I could target an app against it, and one day with no warning around v1.4 the issues were closed and it was finally "good enough". Though both WinUI and MAUI are improving, they're still pretty niggly. |
Maybe @Redth could give this issue a poke, since he likely knows the folk involved in the related fix? |
Thank you so much for your help on that 🙂 |
Hey @mattleibow , I thought I'd give the changes a try early. Should the below changes work?
<!-- Windows specifics-->
<ItemGroup Condition="$([MSBuild]::GetTargetPlatformIdentifier('$(TargetFramework)')) == 'windows'">
<PackageReference Include="Microsoft.Graphics.Win2D" Version="1.2.0" />
</ItemGroup>
With CLR exceptions turned on, I get this error:
|
Facing the same issue as @BurkusCat Fonts still are missing and icons are shown as @mattleibow any chance for a feedback from you? Should this already work or do we need to wait for SR4? |
We are also facing same issue with 8.0.10 and WinUI 1.2.0. |
I opened a new issue here: #21333 |
Just to note here as well as on #21333, that this works OK for me with MAUI 8.0.14 and WinUI 1.2.0. |
I was having a problem all of a sudden today even though my app was working just fine, but then the font doesn't fall within the expected etc. One of the fonts was mistyped as .ttv not .ttf, but then it did it for another font and I'm like wtf, the OpenSans ones were just fine but the only difference between this other font and the three others I have was that there were spaces. I removed them and the exception went away DESPITE, again, working until after I updated to the most recent build 8.0.1 and continued seeing it after upgrading to 9.0.0. |
I think you would better to raise a new issue. |
Description
The Windows FontRegistrar assumes the application is packaged with MSIX (all paths are prefixed with "ms-appx:///"), so font loading fails if/when MSIX packaging is disabled.
https://github.com/dotnet/maui/blob/main/src/Core/src/Fonts/FontRegistrar.Windows.cs#L11
Switching to AddEmbeddedResourceFont also fails unless using MSIX packaging.
Steps to Reproduce
Run the app and see error like:
Link to public reproduction project repository
https://github.com/molesmoke/MauiFontImageSourceTest
Version with bug
7.0.86
Last version that worked well
Unknown/Other
Affected platforms
Windows
Affected platform versions
10.0.19041.0
Did you find any workaround?
Could implement a custom registrar service, but haven't tried
Relevant log output
The text was updated successfully, but these errors were encountered: