// Copyright (c) ppy Pty Ltd . Licensed under the MIT Licence. // See the LICENCE file in the repository root for full licence text. using osu.Framework.Graphics.Sprites; using osu.Game.Graphics; namespace osu.Game.Tournament { public static class TournamentFont { /// /// The default font size. /// public const float DEFAULT_FONT_SIZE = 16; /// /// Retrieves a . /// /// The font typeface. /// The size of the text in local space. For a value of 16, a single line will have a height of 16px. /// The font weight. /// Whether the font is italic. /// Whether all characters should be spaced the same distance apart. /// The . public static FontUsage GetFont(TournamentTypeface typeface = TournamentTypeface.Aquatico, float size = DEFAULT_FONT_SIZE, FontWeight weight = FontWeight.Medium, bool italics = false, bool fixedWidth = false) => new FontUsage(GetFamilyString(typeface), size, GetWeightString(typeface, weight), italics, fixedWidth); /// /// Retrieves the string representation of a . /// /// The . /// The string representation. public static string GetFamilyString(TournamentTypeface typeface) { switch (typeface) { case TournamentTypeface.Aquatico: return "Aquatico"; } return null; } /// /// Retrieves the string representation of a . /// /// The . /// The . /// The string representation of in the specified . public static string GetWeightString(TournamentTypeface typeface, FontWeight weight) => GetWeightString(GetFamilyString(typeface), weight); /// /// Retrieves the string representation of a . /// /// The family string. /// The . /// The string representation of in the specified . public static string GetWeightString(string family, FontWeight weight) { string weightString = weight.ToString(); // Only exo has an explicit "regular" weight, other fonts do not if (weight == FontWeight.Regular && family != GetFamilyString(TournamentTypeface.Aquatico) && family != GetFamilyString(TournamentTypeface.Aquatico)) weightString = string.Empty; return weightString; } } }