get_font_ranges(3)
β¨ get_font_ranges β¨
okay bestie, gather round, it's a get_font_ranges(3) moment π this one lives in the Allegro manual, and it's literally the Allegro game programming library, so you know it's iconic π
πΈ NAME πΈ
get_font_ranges β returns the number of character ranges in a font. Allegro game programming library. π
π¦ SYNOPSIS π¦
#include <allegro.h>
int get_font_ranges(FONT *f)
no cap, that's the whole signature, it's giving short and sweet β¨
π DESCRIPTION π
so like, you call this function when you wanna know how many character ranges are in a font. that's it, that's the job π«Ά
but listen β knowing the count is only the appetizer, bestie. you then gotta go query each one of those ranges with get_font_range_begin() and get_font_range_end() to actually find out what characters are available in the font. like, the count tells you how many lil boxes to open, and those two functions tell you what's inside each box π¦β¨
here's the example, verbatim, because I would never mess with your code:
FONT *f;
int range;
int n;
...
range = get_font_ranges(f);
printf("The font has %d character ranges:\n", range);
for (n = 0; n < range; n++)
printf("Range %d from 0x%03x - 0x%03x\n",
get_font_range_begin(f, n),
get_font_range_end(f, n));
look at that loop go, it's literally the main character π
π RETURN VALUE π
it hands you back the number of continuous character ranges in a font π
OR β and this is the plot twist β it returns -1 if that information is not available π so fr fr, check for the -1, don't just assume you got a real number, that's the vibe check you cannot skip π
π SEE ALSO π
go read these next, they're the whole friend group:
and that's the page, babe π¦ this was Allegro version 4.4.3, documented on the get_font_ranges(3) page β mwah, go forth and count your ranges π
β¨π
π¦ where this page comes from
- fedora 43: allegro-devel 4.4.3.1-18.fc43 Β· Giftware
- fedora 43: allegro-devel 4.4.3.1-18.fc43 Β· Giftware
- fedora 44: allegro-devel 4.4.3.1-20.fc44 Β· Giftware
- fedora 44: allegro-devel 4.4.3.1-20.fc44 Β· Giftware
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms