| | | 1 | | namespace Allyaria.Theming.BrandTypes; |
| | | 2 | | |
| | | 3 | | /// <summary> |
| | | 4 | | /// Represents the font configuration for a brand, providing distinct font families for sans-serif, serif, and monospace |
| | | 5 | | /// text rendering. |
| | | 6 | | /// </summary> |
| | | 7 | | public sealed record BrandFont |
| | | 8 | | { |
| | | 9 | | /// <summary> |
| | | 10 | | /// Initializes a new instance of the <see cref="BrandFont" /> struct with optional sans-serif, serif, and monospace |
| | | 11 | | /// family names. |
| | | 12 | | /// </summary> |
| | | 13 | | /// <param name="sansSerif"> |
| | | 14 | | /// The sans-serif font family name to use. Defaults to <see cref="StyleDefaults.SansSerifFont" /> if null or whites |
| | | 15 | | /// </param> |
| | | 16 | | /// <param name="serif"> |
| | | 17 | | /// The serif font family name to use. Defaults to <see cref="StyleDefaults.SerifFont" /> if null or whitespace. |
| | | 18 | | /// </param> |
| | | 19 | | /// <param name="monospace"> |
| | | 20 | | /// The monospace font family name to use. Defaults to <see cref="StyleDefaults.MonospaceFont" /> if null or whitesp |
| | | 21 | | /// </param> |
| | 161 | 22 | | public BrandFont(string? sansSerif = null, string? serif = null, string? monospace = null) |
| | | 23 | | { |
| | 161 | 24 | | var setMonospace = string.IsNullOrWhiteSpace(value: monospace) |
| | 161 | 25 | | ? StyleDefaults.MonospaceFont |
| | 161 | 26 | | : monospace.Trim(); |
| | | 27 | | |
| | 161 | 28 | | var setSansSerif = string.IsNullOrWhiteSpace(value: sansSerif) |
| | 161 | 29 | | ? StyleDefaults.SansSerifFont |
| | 161 | 30 | | : sansSerif.Trim(); |
| | | 31 | | |
| | 161 | 32 | | var setSerif = string.IsNullOrWhiteSpace(value: serif) |
| | 161 | 33 | | ? StyleDefaults.SerifFont |
| | 161 | 34 | | : serif.Trim(); |
| | | 35 | | |
| | 161 | 36 | | Monospace = setMonospace; |
| | 161 | 37 | | SansSerif = setSansSerif; |
| | 161 | 38 | | Serif = setSerif; |
| | 161 | 39 | | } |
| | | 40 | | |
| | | 41 | | /// <summary>Gets the monospace font family name used for fixed-width text.</summary> |
| | 6 | 42 | | public string Monospace { get; } |
| | | 43 | | |
| | | 44 | | /// <summary>Gets the sans-serif font family name used for general text rendering.</summary> |
| | 27 | 45 | | public string SansSerif { get; } |
| | | 46 | | |
| | | 47 | | /// <summary>Gets the serif font family name used for formal or decorative text rendering.</summary> |
| | 6 | 48 | | public string Serif { get; } |
| | | 49 | | } |