Update of /cvsroot/plib/plib/src/pui
In directory usw-pr-cvs1:/tmp/cvs-serv23103
Modified Files:
puFont.cxx
Log Message:
John F. Fay: Changed line spacing policy; Multiple-line fix for GLUT fonts
Index: puFont.cxx
===================================================================
RCS file: /cvsroot/plib/plib/src/pui/puFont.cxx,v
retrieving revision 1.11
retrieving revision 1.12
diff -u -d -r1.11 -r1.12
--- puFont.cxx 2 Mar 2002 13:54:17 -0000 1.11
+++ puFont.cxx 2 Mar 2002 14:36:24 -0000 1.12
@@ -70,15 +70,15 @@
{
if ( *str == '\n' )
{
- if ( res > max_res ) max_res = res;
- res = 0;
+ if ( res > max_res ) max_res = res ;
+ res = 0 ;
}
else
- {
- res += glutBitmapWidth ( glut_font_handle, *str ) ;
- }
+ res += glutBitmapWidth ( glut_font_handle, *str ) ;
+
str++ ;
}
+
if ( res > max_res ) max_res = res;
return max_res ;
@@ -120,14 +120,14 @@
#ifdef _PU_USE_GLUT_FONTS
if ( glut_font_handle != (GlutFont) 0 )
{
- int i = getGLUTStringHeight ( glut_font_handle ) ;
+ int i = getGLUTStringHeight ( glut_font_handle ) + getStringDescender () ;
int num_lines = 1 ;
for ( const char *p = s ; *p != '\0' ; p++ )
if ( *p == '\n' )
num_lines++ ;
- return i * num_lines ;
+ return ( i * num_lines ) - getStringDescender () ;
}
#endif // #ifdef _PU_USE_GLUT_FONTS
@@ -188,7 +188,7 @@
{
if (*str == '\n')
{
- y -= getStringHeight() * 4 / 3 ;
+ y -= getStringHeight () + getStringDescender () ;
glRasterPos2f( (float)x, (float)y ) ;
}
else
|