Expose Freetype font style flags in FontAsset
This commit is contained in:
@@ -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;
|
||||
|
||||
@@ -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>
|
||||
|
||||
Reference in New Issue
Block a user