diff options
Diffstat (limited to 'source/core')
-rw-r--r-- | source/core/StarFont.cpp | 4 | ||||
-rw-r--r-- | source/core/StarFont.hpp | 1 |
2 files changed, 5 insertions, 0 deletions
diff --git a/source/core/StarFont.cpp b/source/core/StarFont.cpp index 63356ad..b21b85a 100644 --- a/source/core/StarFont.cpp +++ b/source/core/StarFont.cpp @@ -133,4 +133,8 @@ std::pair<Image, Vec2I> Font::render(String::Char c) { return { std::move(image), {slot->bitmap_left - 1, (slot->bitmap_top - height) + (m_pixelSize / 4) - 1} }; } +bool Font::exists(String::Char c) { + return FT_Get_Char_Index(m_fontImpl->face, c); +} + } diff --git a/source/core/StarFont.hpp b/source/core/StarFont.hpp index ec10533..dee50f7 100644 --- a/source/core/StarFont.hpp +++ b/source/core/StarFont.hpp @@ -35,6 +35,7 @@ public: // render a box, but if there is an internal freetype error this may return // an empty image). std::pair<Image, Vec2I> render(String::Char c); + bool exists(String::Char c); private: FontImplPtr m_fontImpl; |