diff --git a/Source/Engine/Render2D/FontAsset.cpp b/Source/Engine/Render2D/FontAsset.cpp
index f000eb3c6..a477e5f4d 100644
--- a/Source/Engine/Render2D/FontAsset.cpp
+++ b/Source/Engine/Render2D/FontAsset.cpp
@@ -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;
diff --git a/Source/Engine/Render2D/FontAsset.h b/Source/Engine/Render2D/FontAsset.h
index 17839d49b..4dea84a5b 100644
--- a/Source/Engine/Render2D/FontAsset.h
+++ b/Source/Engine/Render2D/FontAsset.h
@@ -128,6 +128,11 @@ public:
return _options;
}
+ ///
+ /// Gets the font style flags.
+ ///
+ API_PROPERTY() FontFlags GetStyle() const;
+
///
/// Sets the font options.
///