From cb95b0dea607fd7f29ad8613e844e2830510abad Mon Sep 17 00:00:00 2001 From: bctix <51544115+bctix@users.noreply.github.com> Date: Mon, 16 Dec 2024 13:44:35 -0500 Subject: [PATCH] Move venera bold check to `OsuFont` --- osu.Game/Graphics/OsuFont.cs | 4 ++++ osu.Game/Screens/Play/HUD/BPMCounter.cs | 5 +---- .../Play/HUD/ClicksPerSecond/ClicksPerSecondCounter.cs | 5 +---- osu.Game/Screens/Play/HUD/LongestComboCounter.cs | 5 +---- osu.Game/Screens/Play/HUD/UnstableRateCounter.cs | 5 +---- osu.Game/Skinning/FontAdjustableSkinComponent.cs | 5 +---- 6 files changed, 9 insertions(+), 20 deletions(-) diff --git a/osu.Game/Graphics/OsuFont.cs b/osu.Game/Graphics/OsuFont.cs index 7aa98ece95..556ceb042d 100644 --- a/osu.Game/Graphics/OsuFont.cs +++ b/osu.Game/Graphics/OsuFont.cs @@ -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(); } } diff --git a/osu.Game/Screens/Play/HUD/BPMCounter.cs b/osu.Game/Screens/Play/HUD/BPMCounter.cs index d33dd5d431..5674dac75f 100644 --- a/osu.Game/Screens/Play/HUD/BPMCounter.cs +++ b/osu.Game/Screens/Play/HUD/BPMCounter.cs @@ -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); diff --git a/osu.Game/Screens/Play/HUD/ClicksPerSecond/ClicksPerSecondCounter.cs b/osu.Game/Screens/Play/HUD/ClicksPerSecond/ClicksPerSecondCounter.cs index 85d70a9b2e..ed11651051 100644 --- a/osu.Game/Screens/Play/HUD/ClicksPerSecond/ClicksPerSecondCounter.cs +++ b/osu.Game/Screens/Play/HUD/ClicksPerSecond/ClicksPerSecondCounter.cs @@ -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 }; diff --git a/osu.Game/Screens/Play/HUD/LongestComboCounter.cs b/osu.Game/Screens/Play/HUD/LongestComboCounter.cs index fbbd225c2e..eaab5f2f98 100644 --- a/osu.Game/Screens/Play/HUD/LongestComboCounter.cs +++ b/osu.Game/Screens/Play/HUD/LongestComboCounter.cs @@ -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 }; diff --git a/osu.Game/Screens/Play/HUD/UnstableRateCounter.cs b/osu.Game/Screens/Play/HUD/UnstableRateCounter.cs index d4ecb4f39f..f713c285e7 100644 --- a/osu.Game/Screens/Play/HUD/UnstableRateCounter.cs +++ b/osu.Game/Screens/Play/HUD/UnstableRateCounter.cs @@ -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); diff --git a/osu.Game/Skinning/FontAdjustableSkinComponent.cs b/osu.Game/Skinning/FontAdjustableSkinComponent.cs index 0821edf7fc..e6ecd4f770 100644 --- a/osu.Game/Skinning/FontAdjustableSkinComponent.cs +++ b/osu.Game/Skinning/FontAdjustableSkinComponent.cs @@ -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);