|
|
|
@ -194,12 +194,12 @@ namespace { |
|
|
|
FreeTypeLayouter::FreeTypeLayouter(FreeTypeFont& font, const Float size, const std::string& text): font(font), size(size) { |
|
|
|
FreeTypeLayouter::FreeTypeLayouter(FreeTypeFont& font, const Float size, const std::string& text): font(font), size(size) { |
|
|
|
/* Get glyph codes from characters */ |
|
|
|
/* Get glyph codes from characters */ |
|
|
|
glyphs.reserve(text.size()); |
|
|
|
glyphs.reserve(text.size()); |
|
|
|
_glyphCount = text.size(); |
|
|
|
|
|
|
|
for(std::size_t i = 0; i != text.size(); ) { |
|
|
|
for(std::size_t i = 0; i != text.size(); ) { |
|
|
|
UnsignedInt codepoint; |
|
|
|
UnsignedInt codepoint; |
|
|
|
std::tie(codepoint, i) = Corrade::Utility::Unicode::nextChar(text, i); |
|
|
|
std::tie(codepoint, i) = Corrade::Utility::Unicode::nextChar(text, i); |
|
|
|
glyphs.push_back(FT_Get_Char_Index(font.font(), codepoint)); |
|
|
|
glyphs.push_back(FT_Get_Char_Index(font.font(), codepoint)); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
_glyphCount = glyphs.size(); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
std::tuple<Rectangle, Rectangle, Vector2> FreeTypeLayouter::renderGlyph(const Vector2& cursorPosition, const UnsignedInt i) { |
|
|
|
std::tuple<Rectangle, Rectangle, Vector2> FreeTypeLayouter::renderGlyph(const Vector2& cursorPosition, const UnsignedInt i) { |
|
|
|
|