Merge branch 'freetype_fontstyle' of https://github.com/GoaLitiuM/FlaxEngine into GoaLitiuM-freetype_fontstyle

This commit is contained in:
Wojtek Figat
2023-11-14 10:39:01 +01:00
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>