From 3843646e02adcd3709b5a905a61b8ce70417ce87 Mon Sep 17 00:00:00 2001 From: Youssef Victor Date: Thu, 5 Sep 2024 09:27:26 +0300 Subject: [PATCH] fix: Compare the right font in OnFontLoaded when FontFamily contains '#' --- .../Documents/TextFormatting/FontDetailsCache.skia.cs | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/Uno.UI/UI/Xaml/Documents/TextFormatting/FontDetailsCache.skia.cs b/src/Uno.UI/UI/Xaml/Documents/TextFormatting/FontDetailsCache.skia.cs index 16ab4f02414d..d4199f8cc46b 100644 --- a/src/Uno.UI/UI/Xaml/Documents/TextFormatting/FontDetailsCache.skia.cs +++ b/src/Uno.UI/UI/Xaml/Documents/TextFormatting/FontDetailsCache.skia.cs @@ -93,7 +93,7 @@ private static FontDetails GetFontInternal( SKTypeface? skTypeFace; bool temporaryDefaultFont = false; - + var originalName = name; var hashIndex = name.IndexOf('#'); if (hashIndex > 0) { @@ -112,7 +112,7 @@ private static FontDetails GetFontInternal( else { // Load failed. - OnFontLoaded(name, null); + OnFontLoaded(originalName, null); skTypeFace = null; } } @@ -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)