1
0
mirror of https://github.com/ppy/osu.git synced 2025-01-18 06:22:56 +08:00

Move venera bold check to OsuFont

This commit is contained in:
bctix 2024-12-16 13:44:35 -05:00
parent 5204bd0ecd
commit cb95b0dea6
6 changed files with 9 additions and 20 deletions

View File

@ -87,6 +87,10 @@ namespace osu.Game.Graphics
// torus doesn't have a medium; fallback to regular.
weight = FontWeight.Regular;
// venera only has bold; switch to bold if it isn't
if (family == GetFamilyString(Typeface.Venera) && weight != FontWeight.Bold)
weight = FontWeight.Bold;
return weight.ToString();
}
}

View File

@ -120,10 +120,7 @@ namespace osu.Game.Screens.Play.HUD
Font.BindValueChanged(typeface =>
{
// We only have bold weight for venera, so let's force that.
FontWeight fontWeight = typeface.NewValue == Typeface.Venera ? FontWeight.Bold : FontWeight.Regular;
FontUsage f = OsuFont.GetFont(typeface.NewValue, weight: fontWeight);
FontUsage f = OsuFont.GetFont(typeface.NewValue, weight: FontWeight.Regular);
// Fixed width looks better on venera only in my opinion.
text.Font = f.With(size: 16, fixedWidth: typeface.NewValue == Typeface.Venera);

View File

@ -128,10 +128,7 @@ namespace osu.Game.Screens.Play.HUD.ClicksPerSecond
Font.BindValueChanged(typeface =>
{
// We only have bold weight for venera, so let's force that.
FontWeight fontWeight = typeface.NewValue == Typeface.Venera ? FontWeight.Bold : FontWeight.Regular;
FontUsage f = OsuFont.GetFont(typeface.NewValue, weight: fontWeight);
FontUsage f = OsuFont.GetFont(typeface.NewValue, weight: FontWeight.Regular);
// align baseline with fonts that aren't venera
secLabel.Padding = new MarginPadding { Bottom = typeface.NewValue == Typeface.Venera ? 3f : 2f };

View File

@ -114,10 +114,7 @@ namespace osu.Game.Screens.Play.HUD
Font.BindValueChanged(typeface =>
{
// We only have bold weight for venera, so let's force that.
FontWeight fontWeight = typeface.NewValue == Typeface.Venera ? FontWeight.Bold : FontWeight.Regular;
FontUsage f = OsuFont.GetFont(typeface.NewValue, weight: fontWeight);
FontUsage f = OsuFont.GetFont(typeface.NewValue, weight: FontWeight.Regular);
// align baseline with fonts that aren't venera
comboLabel.Padding = new MarginPadding { Bottom = typeface.NewValue == Typeface.Venera ? 3f : 1f };

View File

@ -156,10 +156,7 @@ namespace osu.Game.Screens.Play.HUD
Font.BindValueChanged(typeface =>
{
// We only have bold weight for venera, so let's force that.
FontWeight fontWeight = typeface.NewValue == Typeface.Venera ? FontWeight.Bold : FontWeight.Regular;
FontUsage f = OsuFont.GetFont(typeface.NewValue, weight: fontWeight);
FontUsage f = OsuFont.GetFont(typeface.NewValue, weight: FontWeight.Regular);
// Fixed width looks better on venera only in my opinion.
text.Font = f.With(size: 16, fixedWidth: typeface.NewValue == Typeface.Venera);

View File

@ -37,10 +37,7 @@ namespace osu.Game.Skinning
Font.BindValueChanged(e =>
{
// We only have bold weight for venera, so let's force that.
FontWeight fontWeight = e.NewValue == Typeface.Venera ? FontWeight.Bold : FontWeight.Regular;
FontUsage f = OsuFont.GetFont(e.NewValue, weight: fontWeight);
FontUsage f = OsuFont.GetFont(e.NewValue, weight: FontWeight.Regular);
SetFont(f);
}, true);