get_font_ranges(3alleg4)
β¨ NAME β¨
get_font_ranges β bestie, this one tells you how many character ranges are chillin' in a font π
(also hi, this is part of the Allegro game programming library, so you know it's giving main character energy in your graphics code π)
πΈ SYNOPSIS πΈ
#include <allegro.h>
int get_font_ranges(FONT *f)
π DESCRIPTION π
okay so, use this function when you need to find out the number of character ranges in a font. that's it, that's the whole vibe β¨
but listen, because this part matters: you should query each of these ranges with get_font_range_begin() and get_font_range_end() to find out what characters are actually available in the font. like, don't just get the count and ghost it, go find out what's inside π¦
example time, no cap:
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 ate π
π₯ RETURN VALUE π₯
returns the number of continuous character ranges in a font. that's the slay. π₯
but if that information is not available, you get -1. so if you're staring at a -1 like ποΈπποΈ, yeah, the font said "i don't know her" and you gotta handle that case yourself, bestie.
π«Ά SEE ALSO π«Ά
go read those too, they're lowkey the whole support system for this one π§
Allegro π version 4.4.3 π and yes this page is literally called get_font_ranges(3alleg4) β mwah, that's the whole thing, periodt. go make something iconic with your fonts πβ¨π
π¦ where this page comes from
- debian bookworm: allegro4-doc 2:4.4.3.1-3 Β· Allegro-gift-ware
- debian trixie: allegro4-doc 2:4.4.3.1-5 Β· Allegro-gift-ware
- ubuntu jammy: allegro4-doc 2:4.4.3.1-2 Β· Allegro-gift-ware
- ubuntu noble: allegro4-doc 2:4.4.3.1-4.1build3 Β· Allegro-gift-ware
- ubuntu questing: allegro4-doc 2:4.4.3.1-6
- ubuntu resolute: allegro4-doc 2:4.4.3.1-7 Β· Allegro-gift-ware
- ubuntu stonking: allegro4-doc 2:4.4.3.1-9 Β· Allegro-gift-ware
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms