diff options
author | Kae <80987908+Novaenia@users.noreply.github.com> | 2023-06-21 00:59:41 +1000 |
---|---|---|
committer | Kae <80987908+Novaenia@users.noreply.github.com> | 2023-06-21 00:59:41 +1000 |
commit | bd783d319557b41b5865d51f306a74abbf7af18c (patch) | |
tree | 5acefc369e7cbc42a1226efb0c28efb9a3d6830e /source/rendering/StarFontTextureGroup.hpp | |
parent | 9b75bd8eb280eb108d9eeef7a17c083a883155c7 (diff) |
make the chat really pretty!!
also slightly optimized text shadow rendering, made sure glyphs with directives stay centered and added two extra Lua arguments to canvas.drawText
Diffstat (limited to 'source/rendering/StarFontTextureGroup.hpp')
-rw-r--r-- | source/rendering/StarFontTextureGroup.hpp | 21 |
1 files changed, 12 insertions, 9 deletions
diff --git a/source/rendering/StarFontTextureGroup.hpp b/source/rendering/StarFontTextureGroup.hpp index d933f1e..17c6467 100644 --- a/source/rendering/StarFontTextureGroup.hpp +++ b/source/rendering/StarFontTextureGroup.hpp @@ -11,24 +11,27 @@ STAR_CLASS(FontTextureGroup); class FontTextureGroup { public: + typedef tuple<String::Char, unsigned, String> GlyphDescriptor; + + struct GlyphTexture { + TexturePtr texture; + int64_t time; + Vec2F processingOffset; + }; + FontTextureGroup(FontPtr font, TextureGroupPtr textureGroup); - TexturePtr glyphTexture(String::Char, unsigned fontSize); - TexturePtr glyphTexture(String::Char, unsigned fontSize, String const& processingDirectives); + const GlyphTexture& glyphTexture(String::Char, unsigned fontSize, String const& processingDirectives); + + TexturePtr glyphTexturePtr(String::Char, unsigned fontSize); + TexturePtr glyphTexturePtr(String::Char, unsigned fontSize, String const& processingDirectives); unsigned glyphWidth(String::Char c, unsigned fontSize); // Removes glyphs that haven't been used in more than the given time in // milliseconds void cleanup(int64_t timeout); - private: - typedef tuple<String::Char, unsigned, String> GlyphDescriptor; - - struct GlyphTexture { - TexturePtr texture; - int64_t time; - }; FontPtr m_font; TextureGroupPtr m_textureGroup; |