diff options
author | bruvzg <7645683+bruvzg@users.noreply.github.com> | 2020-08-05 09:25:28 +0300 |
---|---|---|
committer | bruvzg <7645683+bruvzg@users.noreply.github.com> | 2020-11-26 13:55:26 +0200 |
commit | 493da99269b3a111cf58e0352495e25ee49c5f84 (patch) | |
tree | bc34af12b8f3697ee6da79c1c44e2cfcd8d4b90c /core/string/ustring.cpp | |
parent | a8c2cc9028535aa6f474e93b71b09b5b7402c79d (diff) | |
download | redot-engine-493da99269b3a111cf58e0352495e25ee49c5f84.tar.gz |
[Complex Text Layouts] Implement TextServer interface. Implement Fallback TextServer.
Diffstat (limited to 'core/string/ustring.cpp')
-rw-r--r-- | core/string/ustring.cpp | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/core/string/ustring.cpp b/core/string/ustring.cpp index 213578485e..d630e987ea 100644 --- a/core/string/ustring.cpp +++ b/core/string/ustring.cpp @@ -209,7 +209,6 @@ void CharString::copy_from(const char *p_cstr) { /* String */ /*************************************************************************/ -//TODO: move to TextServer //kind of poor should be rewritten properly String String::word_wrap(int p_chars_per_line) const { int from = 0; @@ -4796,7 +4795,7 @@ Vector<uint8_t> String::to_utf16_buffer() const { Char16String charstr = s->utf16(); Vector<uint8_t> retval; - size_t len = charstr.length() * 2; + size_t len = charstr.length() * sizeof(char16_t); retval.resize(len); uint8_t *w = retval.ptrw(); copymem(w, (const void *)charstr.ptr(), len); @@ -4811,7 +4810,7 @@ Vector<uint8_t> String::to_utf32_buffer() const { } Vector<uint8_t> retval; - size_t len = s->length() * 4; + size_t len = s->length() * sizeof(char32_t); retval.resize(len); uint8_t *w = retval.ptrw(); copymem(w, (const void *)s->ptr(), len); |