Re: [AD] allegro 5 text routines and length parameter

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


My aplogies for the manual formatting as I dont know
how to reply to threads on sourceforge.

From: Elias Pschernig <elias@xxxxxxxxxx...> - 2008-03-10 11:43
On Mon, 2008-03-10 at 04:30 -0700, Doug Eleveld wrote:
>> Hi everyone,
>> 
>> I just downloaded 4.9.2 to try to get an idea about
>> the Allegro 5 text output API. What I noticed is
that
>> they expect a zero terminated string. This can be
>> awkward in some cases and most similar libraries
use a
>> char* with an int length, where a length of -1
means
>> to expect a zero-terminated string.
>> 
>> Are there any plans to have a string length
parameter
>> in the Allegro 5 API? Or should I try to change it
>> myself and submit a patch? 
>> 
>> best regards,
>> 
>
>Can you give an example where this is a problem and
>the int length is an
>advantage?
>
>Anyway, I think we did not decide yet what to do
>with the string API.
>Like, do we want to prefix the A4 string API with
>al_ and just use it in
>A5 1:1?

Most text drawing APIs seem to have a length parameter
(X11, GDI) so I assume its generally considered worth
the effort.

I noticed that length parameter is useful for
character or word-wrapping or even trying to nicely
handle newlines.  With the current API I have to make
a copy of the text (or the pieces) and make sure all
the pieces are null terminated.  Its certainly doable
with the current API but leads to awkward code to do a
relatively simple thing.



      ____________________________________________________________________________________
Never miss a thing.  Make Yahoo your home page. 
http://www.yahoo.com/r/hs




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