From fc7a97c3c671fff28c8be8f0bdbedfdbe56f31d9 Mon Sep 17 00:00:00 2001 From: zhongjin Date: Tue, 22 Nov 2022 00:37:18 +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 | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/3rdparty/fonts/fnt.cxx b/3rdparty/fonts/fnt.cxx index 5e3d381..54eddc3 100644 --- a/3rdparty/fonts/fnt.cxx +++ b/3rdparty/fonts/fnt.cxx @@ -189,6 +189,15 @@ void fntTexFont::getBBox ( const char *s, } if ( (cc & 0XE0) == 0XE0) { SG_LOG(SG_GUI,SG_ALERT, "UTF8 cc=" << cc); + + int x = cc << 4; + cc = (unsigned char) *(s++) ; + + x= x + (cc<<2) >> 4; + + int y = (cc & 0X03 )<< 6 + (unsigned char) *(s++) & 0X7F + + cc = x * 256 + y; } if ( ! exists [ cc ] )