更新 '3rdparty/fonts/fnt.cxx'
This commit is contained in:
parent
9a0718a889
commit
ecf4baa0a2
14
3rdparty/fonts/fnt.cxx
vendored
14
3rdparty/fonts/fnt.cxx
vendored
@ -168,6 +168,7 @@ void fntTexFont::getBBox ( const char *s,
|
||||
//zhongjin
|
||||
SG_LOG(SG_GUI,SG_ALERT, "getBBox " << s);
|
||||
|
||||
|
||||
l = r = b = t = 0.0f ;
|
||||
|
||||
while ( *s != '\0' )
|
||||
@ -180,16 +181,21 @@ void fntTexFont::getBBox ( const char *s,
|
||||
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 ( cc >= 'A' && cc <= 'Z' )
|
||||
cc = cc - 'A' + 'a' ;
|
||||
else
|
||||
if ( cc >= 'a' && cc <= 'z' )
|
||||
cc = cc - 'a' + 'A' ;
|
||||
|
||||
*/
|
||||
if ( cc == ' ' )
|
||||
{
|
||||
r += 0.5f ;
|
||||
@ -220,6 +226,10 @@ void fntTexFont::getBBox ( const char *s,
|
||||
h_pos += gap + ( fixed_pitch ? width : widths[cc] ) ;
|
||||
}
|
||||
|
||||
//zhongjin
|
||||
SG_LOG(SG_GUI,SG_ALERT, "......................");
|
||||
|
||||
|
||||
if ( left != NULL ) *left = l * pointsize ;
|
||||
if ( right != NULL ) *right = r * pointsize ;
|
||||
if ( top != NULL ) *top = t * pointsize ;
|
||||
|
Loading…
Reference in New Issue
Block a user