From 69c69e8b33ab83d7e6a6f06f3691f3bccf413f4c Mon Sep 17 00:00:00 2001 From: Dan Goodliffe Date: Mon, 22 Aug 2022 19:18:37 +0100 Subject: Use utf8_string_view for processing text to renderings --- ui/font.h | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) (limited to 'ui/font.h') diff --git a/ui/font.h b/ui/font.h index f8a29de..52b92a7 100644 --- a/ui/font.h +++ b/ui/font.h @@ -10,6 +10,7 @@ #include #include #include +#include #include class Font { @@ -21,7 +22,7 @@ public: using Quad = std::array; using Quads = std::vector; using TextureQuads = std::map; - TextureQuads render(const std::string_view text) const; + TextureQuads render(const utf8_string_view text) const; struct CharData { size_t textureIdx; @@ -38,12 +39,12 @@ public: static glm::uvec3 getTextureSize(unsigned int height); protected: - void generateChars(const std::string_view text) const; + void generateChars(const utf8_string_view text) const; const CharData getChar(char) const; std::size_t getTextureWithSpace(unsigned int adv) const; std::filesystem::path path; glm::uvec3 size; - mutable std::map charsData; + mutable std::map charsData; mutable std::vector fontTextures; }; -- cgit v1.2.3