From e26e85deb8d18ed99f94a50fd819886673d35c6a Mon Sep 17 00:00:00 2001 From: Sergeanur Date: Sun, 11 Oct 2020 10:33:02 +0300 Subject: Some unicode funcs belong to Font.cpp + small fix --- src/render/Font.cpp | 26 ++++++++++++++++++++++++++ 1 file changed, 26 insertions(+) (limited to 'src/render/Font.cpp') diff --git a/src/render/Font.cpp b/src/render/Font.cpp index 58e44a5b..d0b554dd 100644 --- a/src/render/Font.cpp +++ b/src/render/Font.cpp @@ -4,6 +4,32 @@ #include "TxdStore.h" #include "Font.h" +void +AsciiToUnicode(const char *src, wchar *dst) +{ + while((*dst++ = (unsigned char)*src++) != '\0'); +} + +void +UnicodeStrcat(wchar *dst, wchar *append) +{ + UnicodeStrcpy(&dst[UnicodeStrlen(dst)], append); +} + +void +UnicodeStrcpy(wchar *dst, const wchar *src) +{ + while((*dst++ = *src++) != '\0'); +} + +int +UnicodeStrlen(const wchar *str) +{ + int len; + for(len = 0; *str != '\0'; len++, str++); + return len; +} + CFontDetails CFont::Details; int16 CFont::NewLine; CSprite2d CFont::Sprite[MAX_FONTS]; -- cgit v1.2.3