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

next
zhongjin 2 years ago
parent 9a0718a889
commit ecf4baa0a2

@ -168,6 +168,7 @@ void fntTexFont::getBBox ( const char *s,
//zhongjin //zhongjin
SG_LOG(SG_GUI,SG_ALERT, "getBBox " << s); SG_LOG(SG_GUI,SG_ALERT, "getBBox " << s);
l = r = b = t = 0.0f ; l = r = b = t = 0.0f ;
while ( *s != '\0' ) while ( *s != '\0' )
@ -180,16 +181,21 @@ void fntTexFont::getBBox ( const char *s,
continue ; continue ;
} }
unsigned int cc = (unsigned char) *(s++) ; // unsigned int cc = (unsigned char) *(s++) ;
unsigned int cc = (unsigned int) *(s++) ;
SG_LOG(SG_GUI,SG_ALERT, "cc=" << cc);
if ( ! exists [ cc ] ) if ( ! exists [ cc ] )
{ {
/*
if ( cc >= 'A' && cc <= 'Z' ) if ( cc >= 'A' && cc <= 'Z' )
cc = cc - 'A' + 'a' ; cc = cc - 'A' + 'a' ;
else else
if ( cc >= 'a' && cc <= 'z' ) if ( cc >= 'a' && cc <= 'z' )
cc = cc - 'a' + 'A' ; cc = cc - 'a' + 'A' ;
*/
if ( cc == ' ' ) if ( cc == ' ' )
{ {
r += 0.5f ; r += 0.5f ;
@ -220,6 +226,10 @@ void fntTexFont::getBBox ( const char *s,
h_pos += gap + ( fixed_pitch ? width : widths[cc] ) ; h_pos += gap + ( fixed_pitch ? width : widths[cc] ) ;
} }
//zhongjin
SG_LOG(SG_GUI,SG_ALERT, "......................");
if ( left != NULL ) *left = l * pointsize ; if ( left != NULL ) *left = l * pointsize ;
if ( right != NULL ) *right = r * pointsize ; if ( right != NULL ) *right = r * pointsize ;
if ( top != NULL ) *top = t * pointsize ; if ( top != NULL ) *top = t * pointsize ;

Loading…
Cancel
Save