Re: Re[2]: [AD] character length in given font

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


From: "Bernd Becker" <munin@xxxxxxxxxx>
Subject: Re[2]: [AD] character length in given font


> Hi,
>
> << Can you not use text_length? >>
> This returns the length of the *whole* string. For text wrapping I have to
> check by each letter, especially if a non-proportional font is used; so I
> know where in the string I have to switch to the next line, and not just
> that the line doesn't fit.

So you tokenize the string by whitespace, and keep dropping tokens off the
end until the length of the string is beneath the line length.  Or, if you
must go letter by letter, just pass a string containing only the letter
you're interested in.

--Chris



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