[Complex Text Layouts] Implement TextServer interface. Implement Fallback TextServer.

This commit is contained in:
bruvzg 2020-08-05 09:25:28 +03:00
parent a8c2cc9028
commit 493da99269
No known key found for this signature in database
GPG key ID: FCED35F1CECE0D3A
28 changed files with 5442 additions and 16 deletions

View file

@ -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);