Skip to content

Commit

Permalink
Merge pull request #494 from AndreasReitberger/493-fonts-are-not-load…
Browse files Browse the repository at this point in the history
…ed-if-app-is-published-as-executable

Fixed `MauiFont` embedding
  • Loading branch information
AndreasReitberger authored Apr 10, 2024
2 parents 335b883 + 6948a64 commit 1e6d549
Show file tree
Hide file tree
Showing 5 changed files with 20 additions and 40 deletions.
4 changes: 2 additions & 2 deletions common.props
Original file line number Diff line number Diff line change
Expand Up @@ -36,8 +36,8 @@
</ItemGroup>
-->
<ItemGroup>
<PackageReference Include="Microsoft.Maui.Controls" Version="8.0.14" />
<PackageReference Include="Microsoft.Maui.Controls.Compatibility" Version="8.0.14" />
<PackageReference Include="Microsoft.Maui.Controls" Version="8.0.20" />
<PackageReference Include="Microsoft.Maui.Controls.Compatibility" Version="8.0.20" />
<PackageReference Include="Microsoft.Extensions.Logging.Debug" Version="8.0.0" />
<PackageReference Include="Microsoft.SourceLink.GitHub" Version="8.0.0" PrivateAssets="All"/>
</ItemGroup>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,8 @@ public static MauiAppBuilder RegisterSharedSyncfusionFonts(this MauiAppBuilder b
FontDescriptor fontDescriptor = fonts.FirstOrDefault(f => f.Filename == font.Key);
if (fontDescriptor == null)
{
fonts.AddEmbeddedResourceFont(typeof(AppHostBuilderExtensions).Assembly, font.Key, font.Value);
//fonts.AddFont(font.Key, font.Value);
//fonts.AddEmbeddedResourceFont(typeof(AppHostBuilderExtensions).Assembly, font.Key, font.Value);
fonts.AddFont(font.Key, font.Value);
}
}
});
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -42,34 +42,26 @@
<MauiFont Include="Resources\Fonts\*" />
</ItemGroup>

<ItemGroup>
<MauiFont Remove="Resources\Fonts\UIFontIcons.ttf" />
</ItemGroup>

<ItemGroup>
<None Remove="Resources\Fonts\UIFontIcons.ttf" />
</ItemGroup>

<ItemGroup>
<EmbeddedResource Include="Resources\Fonts\UIFontIcons.ttf" />
</ItemGroup>

<ItemGroup>
<ProjectReference Include="..\SharedMauiXamlStylesLibrary\SharedMauiXamlStylesLibrary.csproj" />
<PackageReference Include="Syncfusion.Maui.Barcode" Version="25.1.38" />
<PackageReference Include="Syncfusion.Maui.Buttons" Version="25.1.38" />
<PackageReference Include="Syncfusion.Maui.Charts" Version="25.1.38" />
<PackageReference Include="Syncfusion.Maui.Core" Version="25.1.38" />
<PackageReference Include="Syncfusion.Maui.DataGrid" Version="25.1.38" />
<PackageReference Include="Syncfusion.Maui.Expander" Version="25.1.38" />
<PackageReference Include="Syncfusion.Maui.Gauges" Version="25.1.38" />
<PackageReference Include="Syncfusion.Maui.Inputs" Version="25.1.38" />
<PackageReference Include="Syncfusion.Maui.ListView" Version="25.1.38" />
<PackageReference Include="Syncfusion.Maui.Picker" Version="25.1.38" />
<PackageReference Include="Syncfusion.Maui.Scheduler" Version="25.1.38" />
<PackageReference Include="Syncfusion.Maui.Sliders" Version="25.1.38" />
<PackageReference Include="Syncfusion.Maui.TabView" Version="25.1.38" />
<PackageReference Include="Syncfusion.Maui.TreeView" Version="25.1.38" />
<PackageReference Include="Syncfusion.Maui.Barcode" Version="25.1.39" />
<PackageReference Include="Syncfusion.Maui.Buttons" Version="25.1.39" />
<PackageReference Include="Syncfusion.Maui.Charts" Version="25.1.39" />
<PackageReference Include="Syncfusion.Maui.Core" Version="25.1.39" />
<PackageReference Include="Syncfusion.Maui.DataGrid" Version="25.1.39" />
<PackageReference Include="Syncfusion.Maui.Expander" Version="25.1.39" />
<PackageReference Include="Syncfusion.Maui.Gauges" Version="25.1.39" />
<PackageReference Include="Syncfusion.Maui.Inputs" Version="25.1.39" />
<PackageReference Include="Syncfusion.Maui.ListView" Version="25.1.39" />
<PackageReference Include="Syncfusion.Maui.Picker" Version="25.1.39" />
<PackageReference Include="Syncfusion.Maui.Scheduler" Version="25.1.39" />
<PackageReference Include="Syncfusion.Maui.Sliders" Version="25.1.39" />
<PackageReference Include="Syncfusion.Maui.TabView" Version="25.1.39" />
<PackageReference Include="Syncfusion.Maui.TreeView" Version="25.1.39" />
</ItemGroup>

<ItemGroup>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,8 @@ public static MauiAppBuilder RegisterSharedFonts(this MauiAppBuilder builder)
FontDescriptor fontDescriptor = fonts.FirstOrDefault(f => f.Filename == font.Key);
if (fontDescriptor == null)
{
fonts.AddEmbeddedResourceFont(typeof(AppHostBuilderExtensions).Assembly, font.Key, font.Value);
//fonts.AddFont(font.Key, font.Value);
//fonts.AddEmbeddedResourceFont(typeof(AppHostBuilderExtensions).Assembly, font.Key, font.Value);
fonts.AddFont(font.Key, font.Value);
}
}
});
Expand Down
12 changes: 0 additions & 12 deletions src/SharedMauiXamlStylesLibrary/SharedMauiXamlStylesLibrary.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -50,18 +50,6 @@
<None Include="..\..\licenses\SharedMauiCoreLibrary.txt" Link="Licenses\LicenseFiles\SharedMauiCoreLibrary.txt" />
</ItemGroup>

<ItemGroup>
<EmbeddedResource Include="Resources\Fonts\FluentFontIcons.ttf" />
<EmbeddedResource Include="Resources\Fonts\FontAwesome5Brands.otf" />
<EmbeddedResource Include="Resources\Fonts\FontAwesome5Regular.otf" />
<EmbeddedResource Include="Resources\Fonts\FontAwesome5Solid.otf" />
<EmbeddedResource Include="Resources\Fonts\materialdesignicons-webfont.ttf" />
<EmbeddedResource Include="Resources\Fonts\Montserrat-Bold.ttf" />
<EmbeddedResource Include="Resources\Fonts\Montserrat-Medium.ttf" />
<EmbeddedResource Include="Resources\Fonts\Montserrat-Regular.ttf" />
<EmbeddedResource Include="Resources\Fonts\Montserrat-SemiBold.ttf" />
</ItemGroup>

<ItemGroup>
<PackageReference Include="SharedMauiCoreLibrary" Version="1.1.6" />
</ItemGroup>
Expand Down

0 comments on commit 1e6d549

Please sign in to comment.