diff options
author | Kae <80987908+Novaenia@users.noreply.github.com> | 2023-06-21 22:29:40 +1000 |
---|---|---|
committer | Kae <80987908+Novaenia@users.noreply.github.com> | 2023-06-21 22:29:40 +1000 |
commit | f0fec34dc9c2dbc86dd424e4963983cbb2ed9b41 (patch) | |
tree | 9073336184d32365b861df91b2fc062c39e0fb15 /source/rendering/StarFontTextureGroup.cpp | |
parent | 865f9a328a9068c9917c52c387f27b3e102712bc (diff) |
The Fontpocalypse
I hate it
Diffstat (limited to 'source/rendering/StarFontTextureGroup.cpp')
-rw-r--r-- | source/rendering/StarFontTextureGroup.cpp | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/source/rendering/StarFontTextureGroup.cpp b/source/rendering/StarFontTextureGroup.cpp index b576ef8..d8c14d0 100644 --- a/source/rendering/StarFontTextureGroup.cpp +++ b/source/rendering/StarFontTextureGroup.cpp @@ -13,13 +13,21 @@ void FontTextureGroup::cleanup(int64_t timeout) { } void FontTextureGroup::switchFont(String const& font) { - if (m_fontName != font) { + if (font.empty()) { + m_font = m_defaultFont; + m_fontName.clear(); + } + else if (m_fontName != font) { m_fontName = font; auto find = m_fonts.find(font); m_font = find != m_fonts.end() ? find->second : m_defaultFont; } } +String const& FontTextureGroup::activeFont() { + return m_fontName; +} + void FontTextureGroup::addFont(FontPtr const& font, String const& name, bool default) { m_fonts[name] = font; if (default) |