Add torus font

This commit is contained in:
Dean Herbert
2020-03-03 18:04:12 +09:00
parent 655b1a9e9d
commit f1f4f1ffbd
12 changed files with 22 additions and 98 deletions

View File

@ -19,6 +19,8 @@ namespace osu.Game.Graphics
public static FontUsage Numeric => GetFont(Typeface.Venera, weight: FontWeight.Regular);
public static FontUsage Torus => GetFont(Typeface.Torus, weight: FontWeight.Regular);
/// <summary>
/// Retrieves a <see cref="FontUsage"/>.
/// </summary>
@ -45,6 +47,9 @@ namespace osu.Game.Graphics
case Typeface.Venera:
return "Venera";
case Typeface.Torus:
return "Torus";
}
return null;
@ -65,16 +70,7 @@ namespace osu.Game.Graphics
/// <param name="family">The family string.</param>
/// <param name="weight">The <see cref="FontWeight"/>.</param>
/// <returns>The string representation of <paramref name="weight"/> in the specified <paramref name="family"/>.</returns>
public static string GetWeightString(string family, FontWeight weight)
{
string weightString = weight.ToString();
// Only exo has an explicit "regular" weight, other fonts do not
if (family != GetFamilyString(Typeface.Exo) && weight == FontWeight.Regular)
weightString = string.Empty;
return weightString;
}
public static string GetWeightString(string family, FontWeight weight) => weight.ToString();
}
public static class OsuFontExtensions
@ -102,6 +98,7 @@ namespace osu.Game.Graphics
{
Exo,
Venera,
Torus
}
public enum FontWeight