al_load_ttf_font_stretch(3alleg5)
π al_load_ttf_font_stretch π
okay bestie, so this one lives in the Allegro 5 reference manual (that's the 3alleg5 situation, iykyk) and it's literally the glow-up version of loading a TTF font β except you get to pick your width AND your height separately instead of squishing everything into one single size. main character energy fr fr π
β¨ SYNOPSIS β¨
#include <allegro5/allegro_ttf.h>
ALLEGRO_FONT *al_load_ttf_font_stretch(char const *filename, int w, int h,
int flags)
πΈ DESCRIPTION πΈ
So basically it's giving al_load_ttf_font(3alleg5), but make it custom. The only difference? Instead of handing over one lil size parameter, you pass separate width and height parameters. That's the whole vibe. π
Now here's the tea on how the stretching actually works:
- If the height is a positive value, and the width is zero or positive, then the font gets stretched according to those parameters. slay. π₯
- > β οΈ but bestie, listen β the width must NOT be negative if the height is positive. that combo is not it.
And just like its sibling al_load_ttf_font(3alleg5), the height can be a negative value, which means "hey, this is the total height in pixels." Iconic. But the catch:
- If the height is negative, then the width must also be negative, or zero. no exceptions, no cap. π
And when do you just get nothing back? When it returns NULL:
- if the height is positive while the width is negative π
- or if the height is negative while the width is positive π
Those two combos are the vibe check you fail. Don't do them.
β SINCE β
5.0.6, 5.1.0 β she's been around a minute, lowkey a legend π
π¦ SEE ALSO π¦
k bye bestie, go stretch some fonts and eat π β this was the Allegro reference manual, al_load_ttf_font_stretch(3alleg5), and yes the whole thing is officially that girl πβ¨
π¦ 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