textout_justify_ex(3alleg4)
π textout_justify_ex π
okay bestie, so this one lives in the Allegro manual β that's the Allegro game programming library, and this page is textout_justify_ex(3alleg4). it's giving "make my text look β¨evenly spacedβ¨" energy, and honestly? iconic. π
β¨ NAME β¨
textout_justify_ex β draws justified text within a region, fr fr. part of the Allegro game programming library π
π¦ SYNOPSIS π¦
#include <allegro.h>
void textout_justify_ex(BITMAP *bmp, const FONT *f, const char *s, int
x1, int x2, int y, int diff, int color, int bg);
πΈ DESCRIPTION πΈ
so what it does is draw justified text inside the region x1-x2. that's the whole vibe. but here's the tea β β if the amount of spare space it's working with is greater than the diff value, it literally gives up and just draws regular left justified text instead. no cap. it's not gonna stretch your words into oblivion, it has boundaries. π«Ά
here's the example, keep it exact bestie:
char *lines[] = {"Draws justified text",
"within the specified",
"x2-x1 area. But not",
"T H I S !", NULL};
/* Show the justification marker. */
vline(screen, 200, 0, SCREEN_H-1, makecol(0, 0, 0));
/* Draw all the lines until we reach a NULL entry. */
for (num = 0, y = 0; lines[num]; num++, y += text_height(font))
textout_justify_ex(screen, font, lines[num], 0, 200,
y, 80, makecol(0, 0, 0),
makecol(255, 255, 255));
see how it just keeps going until it hits a NULL entry? that's the main character loop right there. π
π SEE ALSO π
and that's the whole page bestie, we ate and left no crumbs π β¨ this was Allegro version 4.4.3, so if your code's acting up, check ur version, mwah ππ¦π
π¦ 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