GLUTSTROKEWIDTH
Section: C Library Functions (3)
Updated: LOCAL
Page Index
BSD mandoc
NAME
glutStrokeWidth
- Returns the width in pixels of a character in a given font.
LIBRARY
OpenGLUT - fonts
SYNOPSIS
In openglut.h
Ft float
Fn glutStrokeWidth void *fontID int character
PARAMETERS
Bf Em
fontID
Ef
A GLUT stroked font identifier.
Bf Em
character
Ef
A character code.
DESCRIPTION
This function reports how far the model space origin will advance
if you putput this
Bf Sy
character
Ef
in the font named by
Bf Sy
fontID.
Ef
Not all letters will use their full width, especially in
fixed-width fonts.
Returns 0 if
Bf Sy
character
Ef
is out of range or if the
Bf Sy
fontID
Ef
is invalid.
CAVEATS
Historically, this function has been described as returning a pixel-width, but was implemented to return the width in model-space units, rounded to integers. GLUT never resolved this, and freeglut duplicated the confusion. OpenGLUT has decided to stay in model-space and to return the unrounded floating point value. An unreleased GLUT 3.8 was supposed to include glutStrokeWidthf() and glutStrokeLengthf() (note the *f suffixes), but that is not in wide use.
TODO
Determine if any glyphs are either wider than this function or if they render outside of the bounding box given by
Bf Li
(0,-descent)
Ef
by
Bf Li
(width,height-descent)
Ef
.
SEE ALSO
glutStrokeCharacter(3)
glutStrokeLength(3)
glutStrokeHeightglutBitmapWidth3