al_get_glyph_width(3alleg5)

πŸ“¦
version 5.2.11.3 Β· 4 versions
, in debian trixie, ubuntu questing, ubuntu resolute, ubuntu stonking

πŸ’– al_get_glyph_width β€” Allegro 5 API πŸ’–

okay bestie, sit down, hydrate, and let me tell you about al_get_glyph_width, one of the lil guys from the allegro5 font fam πŸŽ€


✨ NAME ✨

al_get_glyph_width β€” like, the Allegro 5 API obviously πŸ’…


🌸 SYNOPSIS 🌸

#include <allegro5/allegro_font.h>

int al_get_glyph_width(const ALLEGRO_FONT *f, int codepoint)

πŸ¦‹ DESCRIPTION πŸ¦‹

so basically this function is the friend who tells you exactly how wide a thing is before you commit to drawing it, no cap.

It returns the width in pixels of the glyph that corresponds with codepoint in the font font. The parameter is literally named f up in the synopsis, bestie, and yes that's the font. ✨

And if the font does not have such a glyph? It returns zero. Zilch. Nada. Not a crash, not a drama, just a cute little 0. 🫢


⭐ SINCE ⭐

5.1.12 β€” an icon from way back, periodt πŸ‘‘


πŸ’œ SEE ALSO πŸ’œ


fr fr, remember: zero means the glyph isn't in the font. Don't be out here drawing math with a 0 and blaming yourself. It's the font. It's always the font. πŸ’€

that's the whole page, bestie β€” stay slay, measure your glyphs, and go make something iconic βœ¨πŸ’–

Allegro reference manual 🌸 al_get_glyph_width(3alleg5) πŸŽ€ signing off, mwah πŸ’…

πŸ“¦ where this page comes from