GLUTSTROKEWIDTH(3)
π GLUTSTROKEWIDTH(3) π
okay bestie, gather round, because we're talking about glutStrokeWidth from the OpenGLUT - fonts library. yes it's a whole manual page for one lil function and yes it absolutely ate. β¨
πΈ NAME πΈ
glutStrokeWidth β tells you the width, in pixels, of a character in a font you picked. that's it, that's the job. π
π LIBRARY π
OpenGLUT - fonts π
β¨ SYNOPSIS β¨
#include <openglut.h>
float
glutStrokeWidth(void *fontID, int character);
π«Ά PARAMETERS π«Ά
fontIDβ a GLUT stroked font identifier. like, which font are we even talking about here. πcharacterβ a character code. the actual glyph you're curious about. π€
π DESCRIPTION π
so basically: this function reports how far the model space origin will advance if you output this character in the font named by fontID. lowkey important for spacing things out, iykyk. π¦
heads up though β not all letters will use their full width, especially in fixed-width fonts. so like, don't assume every glyph is maxing out its box, because it's not. π
and if character is out of range, or if fontID is invalid? you get 0 back. zero. nothing. go home. π
π CAVEATS π
okay this is the part where it gets messy, buckle up. π’
Historically, this function has been described as returning a pixel-width, but it was actually implemented to return the width in model-space units, rounded to integers. GLUT never resolved this. freeglut duplicated the confusion. it's giving generational trauma fr fr. π
OpenGLUT has decided to stay in model-space and to return the unrounded floating point value. iconic behaviour honestly. β¨
also: an unreleased GLUT 3.8 was supposed to include glutStrokeWidthf() and glutStrokeLengthf() β note the *f suffixes β but that is not in wide use. so like, don't count on it bestie. π
π TODO π
Determine if any glyphs are either wider than this function, or if they render outside of the bounding box given by (0,-descent) by (width,height-descent). π
so yeah, that's an open question. someone go figure it out. not me though. π
π SEE ALSO π
glutStrokeCharacter(3)glutStrokeLength(3)glutStrokeHeight(glutBitmapWidth) 3
π‘ reminder: this page is UNDATED, and the source/version line says UNTITLED(). so it's a mystery page. an enigma. main character energy with no backstory. π΅οΈβοΈ
anyway ily, go measure some glyphs, and remember: model-space units, not pixels. periodt. πβ¨ππ¦πΈπ π«Ά
π¦ where this page comes from
- centos-stream 10: freeglut-devel 3.4.0-9.el10 Β· MIT
- centos-stream 9: freeglut-devel 3.2.1-10.el9 Β· MIT
- centos-stream 9: freeglut-devel 3.2.1-10.el9 Β· MIT
- fedora 43: freeglut-devel 3.6.0-6.fc43 Β· MIT
- fedora 43: freeglut-devel 3.6.0-6.fc43 Β· MIT
- fedora 43: freeglut-devel 3.8.0-1.fc43 Β· MIT
- fedora 43: freeglut-devel 3.8.0-1.fc43 Β· MIT
- fedora 44: freeglut-devel 3.8.0-2.fc44 Β· MIT
- fedora 44: freeglut-devel 3.8.0-2.fc44 Β· MIT
- opensuse-leap 16.0: freeglut-devel 3.2.2-160000.2.2 Β· MIT
- opensuse-leap 16.0: freeglut-devel 3.2.2-160000.2.2 Β· MIT
- opensuse-leap 16.0: freeglut-devel 3.2.2-160000.2.2 Β· MIT
- opensuse-leap 16.0: freeglut-devel 3.2.2-160000.2.2 Β· MIT
- Copyright 2004, the OpenGLUT contributors
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms