GLUTBITMAPWIDTH(3)

πŸ“¦
version 3.8.0 Β· 2 versions
, in centos-stream 10, centos-stream 9, fedora 43, fedora 44, opensuse-leap 16.0

✨ GLUTBITMAPWIDTH ✨

okay bestie, welcome to GLUTBITMAPWIDTH(3) πŸ’– the little function that tells you how WIDE a bitmapped character is gonna be, in pixels. she's short, she's sweet, she's lowkey the backbone of your text layout. let's get into it πŸŽ€


🌸 LIBRARY 🌸

OpenGLUT - bitmapfont πŸ¦‹


πŸ’… SYNOPSIS πŸ’…

#include <openglut.h>

int
glutBitmapWidth(void *font, int character);

like yes, two args, one int coming back at you. no cap. ✨


πŸ“ PARAMETERS πŸ“

  • font β€” a bitmapped font identifier. you know, the whole vibe of which font we're measuring πŸ‘‘
  • character β€” a character code. the actual glyph we're asking about πŸ’œ

🌈 DESCRIPTION 🌈

so here's the tea β˜• β€” this function returns the horizontal OpenGL raster position offset for a character in a bitmapped font. that's the number you use to scoot your raster position over after drawing the glyph. ✨

it's also an upper bound on the width of the bitmapped glyph for character, bestie β€” the way that some letters just don't use their full width, especially fixed-width fonts. she's giving you the maximum, not always the exact. πŸ’…

and if character is out of the inclusive range [0,255], or if the font is invalid? you get 0. that's it. zero. nothing. go home. 😭


🫢 CAVEATS 🫢

not me having to warn you about this πŸ™ˆ β€” in GLUT, some glyphs could render to the left of the starting position, in some fonts. messy behavior, honestly.

but OpenGLUT's fonts all position all of their glyphs to start at, or to the right of, the initial position. so we're safe, we're clean, we're iconic. periodt. πŸ‘‘


πŸ‘€ SEE ALSO πŸ‘€

go read those too, they're all part of the same friend group 🧚


and that's the whole page, babes! this one's UNDATED and comes to you from UNTITLED() β€” mysterious, iconic, no notes. mwah πŸ’‹