extract_font_range(3alleg4)
β¨ extract_font_range β¨
okay bestie, welcome to extract_font_range from the Allegro manual, section 3alleg4 π this one's a lil font-surgery situation and it's honestly so useful, i'm obsessed
πΈ NAME πΈ
extract_font_range β extracts a range of characters from a font. part of the Allegro game programming library, no cap π
π¦ SYNOPSIS π¦
#include <allegro.h>
FONT *extract_font_range(FONT *f, int begin, int end)
π DESCRIPTION π
so like. this function extracts a character range from a font and hands you back a brand new font that contains only the range of characters you selected with this function. literally just the slice you asked for, nothing else, main character energy only π
and here's the cute part: you can pass -1 for either the lower or upper bound if you want to select all characters from the start or to the end of the font. so -1 is giving "idk just take everything from here" π
example time, periodt:
FONT *myfont;
FONT *capitals;
FONT *fontcopy;
...
/* Create a font of only capital letters */
capitals = extract_font_range(myfont, 'A', 'Z');
/* Create a copy of the font */
fontcopy = extract_font_range(myfont, -1, -1);
...
destroy_font(capitals);
destroy_font(fontcopy);
look at that. capitals only?? iconic. full copy of the font?? also iconic. slay π
π RETURN VALUE π
returns a pointer to the new font, or NULL on error π
bestie. listen. you are responsible for destroying the font when you are finished with it, to avoid memory leaks. that's on you fr fr. don't leave it hanging π«Ά
π₯ SEE ALSO π₯
get_font_range_begin(3alleg4)get_font_range_end(3alleg4)merge_fonts(3alleg4)transpose_font(3alleg4)exfont(3alleg4)
and that's the whole page, no notes π this was Allegro, version 4.4.3, extract_font_range(3alleg4) β go forth and slice those fonts, bestie, you're gonna eat β¨ππΈ
π¦ 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