glutStrokeWidth

returns the width/length of a stroke character/string.

Signature

glutStrokeLength( const( string ) )-> int
glutStrokeLength( font , string ) -> <class 'ctypes.c_int'>
glutStrokeLength( c_void_p(font), POINTER(c_ubyte)(string) ) -> c_int
glutStrokeLengthf( const( string ) )-> float
glutStrokeWidth( int( character ) )-> int
glutStrokeWidth( font , character ) -> <class 'ctypes.c_int'>
glutStrokeWidth( c_void_p(font), c_int(character) ) -> c_int
glutStrokeWidthf( int( character ) )-> float

Parameters

VariablesDescription
font
Stroke font to use. For valid values, see the glutStrokeWidth description.
character
Character to return width of (not confined to 8 bits).
string
Text string (8-bit characters), null terminated.

Description

glutStrokeWidthf returns the width in modeling units of a stroke character in a supported stroke font. While the width of characters in a font may vary (though fixed width fonts do not vary), the maximum height characteristics of a particular font are fixed.
glutStrokeLengthf returns the length in modeling units of a string (8-bit characters). This length is equivalent to summing all the widths returned by glutStrokeWidthf for each character in the string.

Bugs

The deprecated glutStrokeWidth and glutStrokeLength routines return an integer rather than a float. Newer GLUT programs should use the newer float-returning routine glutStrokeWidthf and glutStrokeLengthf . Note that these newer float routines do not exist in implementations prior to GLUT 3.8. Also, the glutStrokeLength routine summed integerized character widths so it underestimated the length of strings prior to GLUT 3.8, but the implementation of glutStrokeLength in GLUT 3.8 and beyond sums the character widths for the strings in a float (though glutStrokeLength still returns an integer).

See Also

glutStrokeCharacter glutBitmapWidth