From 4279e16ddb6273a9711ff331d21325dd5f63e769 Mon Sep 17 00:00:00 2001 From: chai Date: Sun, 18 Nov 2018 23:45:58 +0800 Subject: =?UTF-8?q?*=E4=BF=AE=E6=94=B9=E7=9B=AE=E5=BD=95=E4=B8=BA=E5=B0=8F?= =?UTF-8?q?=E5=86=99?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/libjin/Graphics/fonts/je_decoder.cpp | 96 -------------------------------- 1 file changed, 96 deletions(-) delete mode 100644 src/libjin/Graphics/fonts/je_decoder.cpp (limited to 'src/libjin/Graphics/fonts/je_decoder.cpp') diff --git a/src/libjin/Graphics/fonts/je_decoder.cpp b/src/libjin/Graphics/fonts/je_decoder.cpp deleted file mode 100644 index 02112a0..0000000 --- a/src/libjin/Graphics/fonts/je_decoder.cpp +++ /dev/null @@ -1,96 +0,0 @@ -#include -#include -#include "je_decoder.h" - -namespace JinEngine -{ - namespace Graphics - { - namespace Fonts - { - - /* utf8 byte string to unicode codepoint */ - static const char *utf8toCodepoint(const char *p, unsigned *res) { - return nullptr; - - } - - ///////////////////////////////////////////////////////////////////////////// - // decoders - ///////////////////////////////////////////////////////////////////////////// - - const void* Utf8::decode(const void* data, Codepoint* res) const - { - const char* p = (char*)data; - unsigned x, mask, shift; - switch (*p & 0xf0) { - case 0xf0: mask = 0x07; shift = 18; break; - case 0xe0: mask = 0x0f; shift = 12; break; - case 0xc0: - case 0xd0: mask = 0x1f; shift = 6; break; - default: - *res = *p; - return p + 1; - } - x = (*p & mask) << shift; - do { - if (*(++p) == '\0') { - *res = x; - return p; - } - shift -= 6; - x |= (*p & 0x3f) << shift; - } while (shift); - *res = x; - return p + 1; - } - - const void* Utf8::next(const void* data) const - { - const char* p = (char*)data; - unsigned x, mask, shift; - switch (*p & 0xf0) { - case 0xf0: mask = 0x07; shift = 18; break; - case 0xe0: mask = 0x0f; shift = 12; break; - case 0xc0: - case 0xd0: mask = 0x1f; shift = 6; break; - default: - return p + 1; - } - x = (*p & mask) << shift; - do { - if (*(++p) == '\0') { - return p; - } - shift -= 6; - x |= (*p & 0x3f) << shift; - } while (shift); - return p + 1; - } - /* - const void* Utf16::decode(const void* data, Codepoint* res) const - { - return nullptr; - } - - const void* Utf16::next(const void* data) const - { - return nullptr; - } - */ - const void* Ascii::decode(const void* data, Codepoint* res) const - { - const char* p = (char*)data; - *res = *p; - return p + 1; - } - - const void* Ascii::next(const void* data) const - { - const char* p = (char*)data; - return p + 1; - } - - } // namespace Fonts - } // namespace Graphics -} // namespace JinEngine \ No newline at end of file -- cgit v1.1-26-g67d0