Hi guys,
I create a new MAUI project and try to use add charts in pdf exmaple you have.
But when I run the code I get this…
Cannot get a matching glyph typeface for font ‘Calibri’
I need to add manualy Calibri font in MAUI project or I need configure something else?
Thanks
Hi Chuy,
You need to add the font file, please try using something like this in your project file (.csproj):
<ItemGroup>
<MauiFont Include="Resources\Fonts\calibri.ttf" />
</ItemGroup>
And something like this in your “MauiProgram.cs” file:
public static class MauiProgram
{
public static MauiApp CreateMauiApp()
{
var builder = MauiApp.CreateBuilder();
builder
.UseMauiApp<App>()
.ConfigureFonts(fonts =>
{
fonts.AddFont("calibri.ttf", "Calibri");
});
return builder.Build();
}
}
Does this solve your issue?
Regards,
Mario
Hi Mario, thanks for help me.
Amm nop the issue is still there:
New Changes:
- Adding Calibri ttf file as a MauiFont Build Action.
- Add that font in Maui Program file.
- And last step, i think this line takes all fonts files in MAUI project:
I still get this error:
Now maybe I add a wrong ttf file to my project? if you can provide me the correct one will be awsome
And…
I create a public repo with my example project , if you can take a look
NOTE: Project creating by MAUI App Accelerator
Hi Chuy,
Unfortunately, there was an issue, please try again with these latest NuGet packages:
Install-Package GemBox.Spreadsheet -Version 49.0.1451-hotfix
Install-Package GemBox.Pdf -Version 17.0.1402-hotfix
Does this solve your issue?
Regards,
Mario
Hi Mario, thanks for the replay
I try to instal this version 49.0.1448-hotfix and 35.0.1473-hotfix
But I get a not fund version error.
I need to add some specific url in Nuget config?
Or how can I get that versions?
Thanks
Hi Mario,
I cant find those versions (49.0.1448-hotfix and 35.0.1473-hotfix)
But I see a new version in NuGet and I update that version (49.0.1454)
Now I get same bug but different font:
Hi Chuy,
We’re investigating this further, I’ll contact you again later.
Regards,
Mario
Hi Chuy,
Please try again with these latest NuGet packages:
Install-Package GemBox.Spreadsheet -Version 49.0.1463-hotfix
Install-Package GemBox.Document -Version 35.0.1488-hotfix
Install-Package GemBox.Pdf -Version 17.0.1407-hotfix
Does this solve your issue?
Regards,
Mario