al_get_font_ranges(3)
β¨ al_get_font_ranges β¨
okay bestie, so this one's from the Allegro 5 API β yes, the whole library, and this page is literally just about one lil function. it's giving "small but mighty" energy. π
πΈ SYNOPSIS πΈ
like, here's the whole vibe of what you're calling:
#include <allegro5/allegro_font.h>
int al_get_font_ranges(ALLEGRO_FONT *f, int ranges_count, int *ranges)
no cap, that's it. that's the whole signature. π«Ά
π DESCRIPTION π
so this function is basically the font's receipt β it tells you every single glyph that's actually in the font, and it hands them to you as a list of ranges. not one by one, no ma'am, as ranges. and those ranges? they have the exact same format as al_grab_font_from_bitmap(3) uses, so iykyk. π¦
here's the tea on the args:
ranges_countβ this is the maximum number of ranges that will be returned. it's your ceiling, your limit, your "bestie i can only take so much" threshold. πrangesβ this should be an array with room forranges_count * 2elements. yeah, times two. because each range takes up a pair of spots: the even integers are the first unicode point in a range, and the odd integers are the last unicode point in a range. literally alternating, it's a whole pattern. β¨
and the return value? the number of ranges contained in the font β even if it is bigger than ranges_count. π so yes, it will absolutely tell you the truth about how many ranges there are even when your array is too small to hold them all. it's honest like that. not me being told i need 40 ranges when i only brought room for 10. π
β SINCE β
5.1.4 β a vintage queen, an icon, been here a minute. π
π₯ SEE ALSO π₯
al_grab_font_from_bitmap(3)β the sibling, the one with the matching range format. go say hi. π
that's the page, bestie! π§ this lil write-up came from the Allegro reference manual, covering version 5.1.4 of the Allegro 5 API β and yes, check the header date up top if you need the timestamp, 'cause it's right there waiting for you. mwah! ππ
π¦ where this page comes from
- arch rolling: allegro 5.2.11.3-2 Β· Zlib AND BSD-3-Clause AND OFL-1.1 AND LicenseRef-Custom
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms