Browse Source

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

pull/16568/head
Benedikt Stebner 2 years ago
committed by GitHub
parent
commit
9c5aab9d4f
No known key found for this signature in database GPG Key ID: B5690EEEBB952194
  1. 2
      src/Avalonia.Base/Media/Fonts/EmbeddedFontCollection.cs
  2. 2
      src/Avalonia.Base/Media/Fonts/SystemFontCollection.cs

2
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;
}

2
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;
}

Loading…
Cancel
Save