Dashboard/Dashboard.Drawing.OpenGL/Text/DbBlurgFont.cs

29 lines
845 B
C#
Raw Normal View History

2025-01-22 20:42:43 +01:00
using BlurgText;
namespace Dashboard.Drawing.OpenGL.Text
{
public class DbBlurgFont : IFont
{
public IDrawExtension Kind { get; } = BlurgFontExtension.Instance;
2025-01-23 20:00:58 +01:00
public Blurg Owner { get; }
2025-01-22 20:42:43 +01:00
public BlurgFont Font { get; }
public float Size { get; }
public string Family => Font.FamilyName;
public FontWeight Weight => (FontWeight)Font.Weight.Value;
public FontSlant Slant => Font.Italic ? FontSlant.Italic : FontSlant.Normal;
public FontStretch Stretch => FontStretch.Normal;
2025-01-23 20:00:58 +01:00
public DbBlurgFont(Blurg owner, BlurgFont font, float size)
2025-01-22 20:42:43 +01:00
{
2025-01-23 20:00:58 +01:00
Owner = owner;
2025-01-22 20:42:43 +01:00
Font = font;
Size = size;
}
public DbBlurgFont WithSize(float size)
{
2025-01-23 20:00:58 +01:00
return new DbBlurgFont(Owner, Font, size);
2025-01-22 20:42:43 +01:00
}
}
}