AL_LOAD_TTF_FONT_STRETCH(3)
β¨ al_load_ttf_font_stretch(3) β¨
ok so bestie, this one lives in the Library Functions Manual and it's literally the glow-up version of loading a font π
πΈ NAME πΈ
al_load_ttf_font_stretch β the Allegro 5 API girlie who loads your TTF fonts and lets you stretch them π
π¦ SYNOPSIS π¦
#include <allegro5/allegro_ttf.h>
ALLEGRO_FONT *al_load_ttf_font_stretch(char const *filename, int w, int h,
int flags)
π DESCRIPTION π
okay so picture al_load_ttf_font(3)β¦ but make it give you more π«Ά It's exactly like that function, except instead of one single size parameter it takes separate w and h parameters. Two of them. Iconic, honestly.
Here's the vibe check on how the numbers work π
- if
h(the height) is a positive value, andw(the width) is zero or positive, then the font gets stretched according to those parameters. slay π - the width must not be negative if the height is positive. fr fr, that's a hard no π
- and same energy as
al_load_ttf_font(3): the height may be a negative value, which means "specify the total height in pixels" β and in that case the width must also be negative, or zero. no mixing and matching π
and if you get it wrong? it returns NULL π specifically: if the height is positive while the width is negative, or if the height is negative while the width is positive. Those combos are not the moment, bestie.
β SINCE β
5.0.6, 5.1.0 β she's been around a minute π
π SEE ALSO π
al_load_ttf_font(3)β the original, no stretchal_load_ttf_font_stretch_f(3)β the_fsibling β¨
and that's the whole page, no cap π this was the Allegro reference manual dropping al_load_ttf_font_stretch(3) knowledge β go stretch something cute π§
π¦ 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