Expose Freetype font style flags in FontAsset

This commit is contained in:
2023-11-10 21:32:18 +02:00
parent 43ae0bcd4c
commit dc7170c51e
2 changed files with 15 additions and 0 deletions

View File

@@ -87,6 +87,16 @@ bool FontAsset::Init()
return error;
}
FontFlags FontAsset::GetStyle() const
{
FontFlags flags = FontFlags::None;
if ((_face->style_flags & FT_STYLE_FLAG_ITALIC) != 0)
flags |= FontFlags::Italic;
if ((_face->style_flags & FT_STYLE_FLAG_BOLD) != 0)
flags |= FontFlags::Bold;
return flags;
}
void FontAsset::SetOptions(const FontOptions& value)
{
_options = value;

View File

@@ -128,6 +128,11 @@ public:
return _options;
}
/// <summary>
/// Gets the font style flags.
/// </summary>
API_PROPERTY() FontFlags GetStyle() const;
/// <summary>
/// Sets the font options.
/// </summary>