From f31a6e7da2e270dc3dca756e1b54f29e5dbeadf5 Mon Sep 17 00:00:00 2001 From: zhongjin Date: Tue, 22 Nov 2022 00:57:13 +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 | 19 +++++++++++++++---- 1 file changed, 15 insertions(+), 4 deletions(-) diff --git a/3rdparty/fonts/fnt.cxx b/3rdparty/fonts/fnt.cxx index 302caaf..beb842b 100644 --- a/3rdparty/fonts/fnt.cxx +++ b/3rdparty/fonts/fnt.cxx @@ -191,14 +191,25 @@ void fntTexFont::getBBox ( const char *s, SG_LOG(SG_GUI,SG_ALERT, "UTF8 cc=" << cc); int x = cc << 4; + + SG_LOG(SG_GUI,SG_ALERT, "UTF8 cc<<4 " << x); + + cc = (unsigned char) *(s++) ; - x= x + (cc<<2) >> 4; + SG_LOG(SG_GUI,SG_ALERT, "UTF81 cc=" << cc); - int y = (cc & 0X03 )<< 6 + (unsigned char) *(s++) & 0X7F; + x= x + (cc>>2) & 0x0F; - cc = x * 256 + y; - SG_LOG(SG_GUI,SG_ALERT, "U =" << cc); + int y = (cc & 0x03) * 0X3F; + + 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); } if ( ! exists [ cc ] )