1
0
mirror of https://github.com/ppy/osu.git synced 2025-01-30 04:23:21 +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. // torus doesn't have a medium; fallback to regular.
weight = FontWeight.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(); return weight.ToString();
} }
} }

View File

@ -120,10 +120,7 @@ namespace osu.Game.Screens.Play.HUD
Font.BindValueChanged(typeface => Font.BindValueChanged(typeface =>
{ {
// We only have bold weight for venera, so let's force that. FontUsage f = OsuFont.GetFont(typeface.NewValue, weight: FontWeight.Regular);
FontWeight fontWeight = typeface.NewValue == Typeface.Venera ? FontWeight.Bold : FontWeight.Regular;
FontUsage f = OsuFont.GetFont(typeface.NewValue, weight: fontWeight);
// Fixed width looks better on venera only in my opinion. // Fixed width looks better on venera only in my opinion.
text.Font = f.With(size: 16, fixedWidth: typeface.NewValue == Typeface.Venera); 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 => Font.BindValueChanged(typeface =>
{ {
// We only have bold weight for venera, so let's force that. FontUsage f = OsuFont.GetFont(typeface.NewValue, weight: FontWeight.Regular);
FontWeight fontWeight = typeface.NewValue == Typeface.Venera ? FontWeight.Bold : FontWeight.Regular;
FontUsage f = OsuFont.GetFont(typeface.NewValue, weight: fontWeight);
// align baseline with fonts that aren't venera // align baseline with fonts that aren't venera
secLabel.Padding = new MarginPadding { Bottom = typeface.NewValue == Typeface.Venera ? 3f : 2f }; 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 => Font.BindValueChanged(typeface =>
{ {
// We only have bold weight for venera, so let's force that. FontUsage f = OsuFont.GetFont(typeface.NewValue, weight: FontWeight.Regular);
FontWeight fontWeight = typeface.NewValue == Typeface.Venera ? FontWeight.Bold : FontWeight.Regular;
FontUsage f = OsuFont.GetFont(typeface.NewValue, weight: fontWeight);
// align baseline with fonts that aren't venera // align baseline with fonts that aren't venera
comboLabel.Padding = new MarginPadding { Bottom = typeface.NewValue == Typeface.Venera ? 3f : 1f }; 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 => Font.BindValueChanged(typeface =>
{ {
// We only have bold weight for venera, so let's force that. FontUsage f = OsuFont.GetFont(typeface.NewValue, weight: FontWeight.Regular);
FontWeight fontWeight = typeface.NewValue == Typeface.Venera ? FontWeight.Bold : FontWeight.Regular;
FontUsage f = OsuFont.GetFont(typeface.NewValue, weight: fontWeight);
// Fixed width looks better on venera only in my opinion. // Fixed width looks better on venera only in my opinion.
text.Font = f.With(size: 16, fixedWidth: typeface.NewValue == Typeface.Venera); text.Font = f.With(size: 16, fixedWidth: typeface.NewValue == Typeface.Venera);

View File

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