diff --git a/3rdparty/fonts/fnt.cxx b/3rdparty/fonts/fnt.cxx index 50e619e..f340e28 100644 --- a/3rdparty/fonts/fnt.cxx +++ b/3rdparty/fonts/fnt.cxx @@ -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 ;