From 1374f16fe9ddb901bd6efaf09dbce3eff65f1c4f Mon Sep 17 00:00:00 2001 From: zhongjin Date: Tue, 22 Nov 2022 12:14:24 +0800 Subject: [PATCH] =?UTF-8?q?=E6=9B=B4=E6=96=B0=20'3rdparty/fonts/fnt.cxx'?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- 3rdparty/fonts/fnt.cxx | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/3rdparty/fonts/fnt.cxx b/3rdparty/fonts/fnt.cxx index 9aca71e..cd4a1de 100644 --- a/3rdparty/fonts/fnt.cxx +++ b/3rdparty/fonts/fnt.cxx @@ -291,6 +291,20 @@ void fntTexFont::puts ( sgVec3 curpos, float pointsize, float italic, const char } else + if ( (cc & 0XE0) == 0XE0) { + int x = (cc & 0X0F) << 4; + //SG_LOG(SG_GUI,SG_ALERT, "UTF8 cc<<4 " << x); + cc = (unsigned char) *(s++) ; + //SG_LOG(SG_GUI,SG_ALERT, "UTF81 cc=" << cc); + x= x + ((cc & 0x3C) >>2 ) ; + int y = (cc & 0x03) << 6 ; + cc = (unsigned char) *(s++) ; + //SG_LOG(SG_GUI,SG_ALERT, "UTF82 cc=" << cc); + y= y + (cc & 0x3F); + //SG_LOG(SG_GUI,SG_ALERT, "x=" << x << ",y=" << y); + cc = x * 256 + y; + //SG_LOG(SG_GUI,SG_ALERT, "UTF8 cc=" << cc); + } SG_LOG(SG_GUI,SG_ALERT, "lputs->ow_putch " << cc);