Веб-сайт самохостера Lotigara

summaryrefslogtreecommitdiff
path: root/source/rendering/StarFontTextureGroup.hpp
diff options
context:
space:
mode:
authorKae <80987908+Novaenia@users.noreply.github.com>2024-04-24 07:44:53 +1000
committerKae <80987908+Novaenia@users.noreply.github.com>2024-04-24 07:44:53 +1000
commitd0f8aec244a0d71f67863f94cab4c5f84d93de22 (patch)
treea8e69fa28b7841d942e7e5f994518a69916c45c8 /source/rendering/StarFontTextureGroup.hpp
parent6ac139321b2a03d71192f852ff958cf6176e1c2d (diff)
feat: unicode emoji support + other stuff
Diffstat (limited to 'source/rendering/StarFontTextureGroup.hpp')
-rw-r--r--source/rendering/StarFontTextureGroup.hpp13
1 files changed, 8 insertions, 5 deletions
diff --git a/source/rendering/StarFontTextureGroup.hpp b/source/rendering/StarFontTextureGroup.hpp
index 864b44f..b2fa572 100644
--- a/source/rendering/StarFontTextureGroup.hpp
+++ b/source/rendering/StarFontTextureGroup.hpp
@@ -16,7 +16,8 @@ public:
struct GlyphTexture {
TexturePtr texture;
- int64_t time;
+ bool colored = false;
+ int64_t time = 0;
Vec2F offset;
};
@@ -35,16 +36,18 @@ public:
// Switches the current font
void switchFont(String const& font);
String const& activeFont();
- void addFont(FontPtr const& font, String const& name, bool isDefault = false);
+ void addFont(FontPtr const& font, String const& name);
void clearFonts();
- void setFallbackFont(String const& fontName);
-
+ void setFixedFonts(String const& defaultFontName, String const& fallbackFontName, String const& emojiFontName);
private:
+ Font* getFontForCharacter(String::Char);
+
CaseInsensitiveStringMap<FontPtr> m_fonts;
String m_fontName;
- FontPtr m_font;
+ FontPtr m_activeFont;
FontPtr m_defaultFont;
FontPtr m_fallbackFont;
+ FontPtr m_emojiFont;
TextureGroupPtr m_textureGroup;
HashMap<GlyphDescriptor, GlyphTexture> m_glyphs;