al_get_font_ranges(3alleg5)
π al_get_font_ranges β the Allegro 5 API glow-up π
okay bestie, so this one lives in the Allegro 5 manual, and it's literally the way you find out which glyphs a font is actually packing. no cap.
β¨ SYNOPSIS β¨
#include <allegro5/allegro_font.h>
int al_get_font_ranges(ALLEGRO_FONT *f, int ranges_count, int *ranges)
πΈ DESCRIPTION πΈ
so basically al_get_font_ranges hands you the tea on every single glyph that's chillin' inside a font, and it serves it up as a list of ranges. and the ranges? they use the exact same format as al_grab_font_from_bitmap(3alleg5), so if you already know that one you're already slaying.
here's the breakdown, bestie:
ranges_countis the maximum number of ranges that will be returned. it's the cap, the limit, the "that's enough" of it all.rangesneeds to be an array with room forranges_count * 2elements. and the way the numbers work is giving pattern energy: the even integers are the first unicode point in a range, and the odd integers are the last unicode point in a range. even = start, odd = end. iykyk. π
and the return value? it gives you back the number of ranges contained in the font β and yes, even if that number is bigger than ranges_count. so it'll tell you the truth even when your array can't hold the whole truth. iconic honesty fr fr. π
β SINCE β
5.1.4
π¦ SEE ALSO π¦
heads up bestie: if the font has more ranges than ranges_count, you're only getting the first chunk back in your array β but the return value still spills the real total. so like, vibe check your buffer sizes. π«Ά
that's the whole page, and yes it ate. this was the Allegro reference manual talking about al_get_font_ranges(3alleg5) β go forth and range responsibly, main character. πβ¨π
π¦ where this page comes from
- debian trixie: allegro5-doc 2:5.2.10.1+dfsg-1 Β· Zlib
- ubuntu questing: allegro5-doc 2:5.2.10.1+dfsg-1build1
- ubuntu resolute: allegro5-doc 2:5.2.11.3+dfsg-1 Β· Zlib
- ubuntu stonking: allegro5-doc 2:5.2.11.3+dfsg-1 Β· Zlib
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms