textout_justify_ex(3)
π textout_justify_ex π
okay bestie, so this one lives in the Allegro manual, it's a section 3 page, and it's literally called textout_justify_ex β say that three times fast, I dare you. it's from the Allegro game programming library, and it's giving justified text energy β¨
β¨ 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: it draws justified text inside the region x1-x2. periodt. π
but here's the tea π« β if the amount of spare space is greater than the diff value, it does NOT fight it. it just gives up and draws regular left justified text instead. like, it knows when to fold, and honestly? respect. π
check the example, it's iconic:
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 "T H I S !" never gets stretched? that's the diff doing its little job. no cap. π₯
π¦ SEE ALSO π¦
and that's the whole page, bestie!! π this was pulled straight from Allegro, version 4.4.3, and the page itself goes by textout_justify_ex(3). go justify some text, you absolute main character ππ
π¦ where this page comes from
- fedora 43: allegro-devel 4.4.3.1-18.fc43 Β· Giftware
- fedora 43: allegro-devel 4.4.3.1-18.fc43 Β· Giftware
- fedora 44: allegro-devel 4.4.3.1-20.fc44 Β· Giftware
- fedora 44: allegro-devel 4.4.3.1-20.fc44 Β· Giftware
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms