X-Git-Url: http://git.mutantstargoat.com/user/nuclear/?a=blobdiff_plain;f=src%2Ffg_font.c;h=7502a0be9045326a5fd8821b6d117668cdde3f53;hb=2c12c9eb8d63cabac2d4113b4f54fdf53da8368c;hp=c0f04796ab9d25624a1ee71623b9a7b6bc665c91;hpb=05a61612c9b96b61ca9917def47eb59b7bd195c8;p=freeglut diff --git a/src/fg_font.c b/src/fg_font.c index c0f0479..7502a0b 100644 --- a/src/fg_font.c +++ b/src/fg_font.c @@ -1,5 +1,5 @@ /* - * freeglut_font.c + * fg_font.c * * Bitmap and stroke fonts displaying. * @@ -37,7 +37,7 @@ /* -- IMPORT DECLARATIONS -------------------------------------------------- */ /* - * These are the font faces defined in freeglut_font_data.c file: + * These are the font faces defined in fg_font_data.c file: */ extern SFG_Font fgFontFixed8x13; extern SFG_Font fgFontFixed9x15; @@ -278,10 +278,14 @@ void FGAPIENTRY glutStrokeCharacter( void* fontID, int character ) for( j = 0; j < strip->Number; j++ ) glVertex2f( strip->Vertices[ j ].X, strip->Vertices[ j ].Y ); glEnd( ); - glBegin( GL_POINTS ); - for( j = 0; j < strip->Number; j++ ) - glVertex2f( strip->Vertices[ j ].X, strip->Vertices[ j ].Y ); - glEnd( ); + + if (fgState.StrokeFontDrawJoinDots) + { + glBegin( GL_POINTS ); + for( j = 0; j < strip->Number; j++ ) + glVertex2f( strip->Vertices[ j ].X, strip->Vertices[ j ].Y ); + glEnd( ); + } } glTranslatef( schar->Right, 0.0, 0.0 ); } @@ -342,7 +346,7 @@ void FGAPIENTRY glutStrokeString( void* fontID, const unsigned char *string ) /* * Return the width in pixels of a stroke character */ -int FGAPIENTRY glutStrokeWidth( void* fontID, int character ) +GLfloat FGAPIENTRY glutStrokeWidthf( void* fontID, int character ) { const SFG_StrokeChar *schar; SFG_StrokeFont* font; @@ -360,17 +364,21 @@ int FGAPIENTRY glutStrokeWidth( void* fontID, int character ) schar = font->Characters[ character ]; freeglut_return_val_if_fail( schar, 0 ); - return ( int )( schar->Right + 0.5 ); + return schar->Right; +} +int FGAPIENTRY glutStrokeWidth(void* fontID, int character) +{ + return ( int )( glutStrokeWidthf(fontID,character) + 0.5f ); } /* * Return the width of a string drawn using a stroke font */ -int FGAPIENTRY glutStrokeLength( void* fontID, const unsigned char* string ) +GLfloat FGAPIENTRY glutStrokeLengthf( void* fontID, const unsigned char* string ) { unsigned char c; - float length = 0.0; - float this_line_length = 0.0; + GLfloat length = 0.0; + GLfloat this_line_length = 0.0; SFG_StrokeFont* font; FREEGLUT_EXIT_IF_NOT_INITIALISED ( "glutStrokeLength" ); font = fghStrokeByID( fontID ); @@ -400,7 +408,11 @@ int FGAPIENTRY glutStrokeLength( void* fontID, const unsigned char* string ) } if( length < this_line_length ) length = this_line_length; - return( int )( length + 0.5 ); + return length; +} +int FGAPIENTRY glutStrokeLength( void* fontID, const unsigned char* string ) +{ + return( int )( glutStrokeLengthf(fontID,string) + 0.5f ); } /*