enisn / UraniumUI

Uranium is a Free & Open-Source UI Kit for MAUI.
Apache License 2.0
1.05k stars 121 forks source link

Embedded Icon Packs Don't Work in Unpackaged App #687

Open lkomanetz opened 1 week ago

lkomanetz commented 1 week ago

Using v2.8.1 I added the FontAwesome icon pack to my MAUI project and made sure to include the AddFontAwesomeIconFonts extension method in the MauiProgram.cs file. During development, and when creating an MSIX package, the icons that I was using were working without any issue. When I built the project as an unpackaged app the icons were only showing as little squares (indicating it couldn't find them).

To fix the issue I had to download the font files from src/UraniumUI.Icons.FontAwesome/Resources/Fonts into the Resources/Fonts folder in my MAUI project, make sure those files were MauiFont resources that were set to copy always, and then register them in the default way (using the same aliases as the extension method uses).

The expectation, since they are embedded resources, was that everything would work as both an MSIX package or unpackaged app without having to make any code changes.

enisn commented 1 week ago

I haven't considered unpacked msix application, but still MAUI provides an API to use embedded fonts, so MAUI should extract embedded fonts from dll and use them automatically. I'll check and create an issue to MAUI repository if it's related to maui

lkomanetz commented 1 week ago

@enisn I remember checking the output folder and not seeing the FontAwesome font files. My assumption was that since they were embedded resources they would be part of the EXE but it was just an assumption. If I can find time I'll try to look into it some more and help out but I've been swamped lately.