更新 '3rdparty/fonts/fnt.cxx'

This commit is contained in:
zhongjin 2022-11-22 11:59:18 +08:00
parent 57351b02f2
commit 662340a667

View File

@ -48,38 +48,6 @@ float fntTexFont::low_putch ( sgVec3 curpos, float pointsize,
/* Auto case-convert if character is absent from font. */ /* Auto case-convert if character is absent from font. */
if ((cc & 0x80)==0) {
SG_LOG(SG_GUI,SG_ALERT, "ASSIC cc=" << cc);
}
if ( (cc & 0XE0) == 0XE0) {
int x = (cc & 0X0F) << 4;
//SG_LOG(SG_GUI,SG_ALERT, "UTF8 cc<<4 " << x);
cc = (unsigned char) *(c++) ;
//SG_LOG(SG_GUI,SG_ALERT, "UTF81 cc=" << cc);
x= x + ((cc & 0x3C) >>2 ) ;
int y = (cc & 0x03) << 6 ;
cc = (unsigned char) *(c++) ;
//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);
}
//zhongjin //zhongjin
if ( ! exists [ cc ] ) if ( ! exists [ cc ] )
{ {
@ -308,6 +276,9 @@ void fntTexFont::puts ( sgVec3 curpos, float pointsize, float italic, const char
if ( ! bound ) if ( ! bound )
bind_texture () ; bind_texture () ;
//zhongjin
SG_LOG(SG_GUI,SG_ALERT, "puts " << s);
while ( *s != '\0' ) while ( *s != '\0' )
{ {
if (*s == '\n') if (*s == '\n')