[AD] Multiline text

[ Thread Index | Date Index | More lists.liballeg.org/allegro-developers Archives ]


On the forums, people have asked numerous times for multiline text drawing.
With this patch/pull request I have tried to strike a balance between
features and the desire not to bloat Allegro too much.

Text will be broken into lines either on a newline character to force
a line break, or on a space or tab if the text is wider than the
max_width parameter. The line height can be set as a parameter or when set
to 0, the font's line height is used as a default.

There are also functions that calculate the dimensions of the bounds
box of a multi line
text without actually drawing it. There is support for both ALLEGRO_USTR
and char * strings.

There is an example program ex_font_multiline.cpp to test out these
functions with.

The pull request is available here:
https://github.com/liballeg/allegro5/pull/4

And the patch to apply with git am is here:
https://github.com/liballeg/allegro5/pull/4.patch

Kind Regards,

Beoran.




Mail converted by MHonArc 2.6.19+ http://listengine.tuxfamily.org/