Browse Source

Do not embolden a typeface that already has a higher weight than the requested (#16538)

Benedikt Stebner 1 year ago
parent
commit
9c5aab9d4f

+ 1 - 1
src/Avalonia.Base/Media/Fonts/EmbeddedFontCollection.cs

@@ -81,7 +81,7 @@ namespace Avalonia.Media.Fonts
                             fontSimulations |= FontSimulations.Oblique;
                         }
 
-                        if ((int)weight >= 600 && glyphTypeface2.Weight != weight)
+                        if ((int)weight >= 600 && glyphTypeface2.Weight < weight)
                         {
                             fontSimulations |= FontSimulations.Bold;
                         }

+ 1 - 1
src/Avalonia.Base/Media/Fonts/SystemFontCollection.cs

@@ -113,7 +113,7 @@ namespace Avalonia.Media.Fonts
                     fontSimulations |= FontSimulations.Oblique;
                 }
 
-                if ((int)weight >= 600 && glyphTypeface2.Weight != weight)
+                if ((int)weight >= 600 && glyphTypeface2.Weight < weight)
                 {
                     fontSimulations |= FontSimulations.Bold;
                 }