al_draw_justified_text(3alleg5)
π NAME π
al_draw_justified_text β it's the Allegro 5 API girlies' fave for making text stretch all the way across, bestie β¨
πΈ SYNOPSIS πΈ
#include <allegro5/allegro_font.h>
void al_draw_justified_text(const ALLEGRO_FONT *font,
ALLEGRO_COLOR color, float x1, float x2,
float y, float diff, int flags, const char *text)
β¨ DESCRIPTION β¨
okay so picture al_draw_text(3alleg5) but it justifies your string so it fills the region from x1 to x2. like, the words get spaced out so both edges line up. it's giving typography π
the diff parameter is the maximum amount of horizontal space you're willing to allow between words. no cap. so if justifying the text would blow past diff pixels, or if your string has fewer than two words (can't space out one word, babe π), then the string just gets drawn left aligned instead. it settles. it's fine.
the flags parameter can be 0 or one of these bad boys:
ALLEGRO_ALIGN_INTEGERβ Draw text aligned to integer pixel positions. Since: 5.0.8, 5.1.5
π¦ SEE ALSO π¦
okay that's the whole page, you ate that π«Ά this was the Allegro reference manual version of al_draw_justified_text, page 3alleg5, and yeah bestie it's al_draw_justified_text(3alleg5) all the way down β mwah π
π¦ 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