diff --git a/desktop_version/src/Textbox.cpp b/desktop_version/src/Textbox.cpp index 8cd0d63e..f08f11a9 100644 --- a/desktop_version/src/Textbox.cpp +++ b/desktop_version/src/Textbox.cpp @@ -1,9 +1,9 @@ #include "Textbox.h" #include -#include #include "Font.h" +#include "UTF8.h" textboxclass::textboxclass(void) { @@ -145,7 +145,7 @@ void textboxclass::padtowidth(size_t new_w) size_t chars_w = SDL_max(w-16, new_w) / glyph_w; for (size_t iter = 0; iter < lines.size(); iter++) { - size_t n_glyphs = utf8::unchecked::distance(lines[iter].begin(), lines[iter].end()); + size_t n_glyphs = UTF8_total_codepoints(lines[iter].c_str()); signed int padding_needed = chars_w - n_glyphs; if (padding_needed < 0) {