Skip to content

Commit

Permalink
fix: Compare the right font in OnFontLoaded when FontFamily contains '#'
Browse files Browse the repository at this point in the history
  • Loading branch information
Youssef1313 authored Sep 5, 2024
1 parent 05b4e32 commit 3843646
Showing 1 changed file with 4 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@ private static FontDetails GetFontInternal(

SKTypeface? skTypeFace;
bool temporaryDefaultFont = false;

var originalName = name;
var hashIndex = name.IndexOf('#');
if (hashIndex > 0)
{
Expand All @@ -112,7 +112,7 @@ private static FontDetails GetFontInternal(
else
{
// Load failed.
OnFontLoaded(name, null);
OnFontLoaded(originalName, null);
skTypeFace = null;
}
}
Expand All @@ -128,12 +128,12 @@ private static FontDetails GetFontInternal(
{
if (task.IsCompletedSuccessfully)
{
OnFontLoaded(name, task.Result);
OnFontLoaded(originalName, task.Result);
}
else
{
// Load failed.
OnFontLoaded(name, null);
OnFontLoaded(originalName, null);
}
}
catch (Exception e)
Expand Down

0 comments on commit 3843646

Please sign in to comment.