On 2006-11-24, Luc Le Blanc <[EMAIL PROTECTED]> wrote:
> Luc Le Blanc wrote:
>
>> Regis St-Gelais wrote:
>
>>>Luc Le Blanc" <[EMAIL PROTECTED]> a ?crit dans le message de news:
>>>[EMAIL PROTECTED]
>>>> How can I determine the screen width of a string containing
>>>> FntCharsWidth ignores them :(
>
>>>Correct me if i'm wrong but WinDrawChars and similar APIs will not 
>>>print the TAB anyway.
>
>
>>I don't know about WinDrawChars, but fields do write tabs and this
>>is where I need to know the width of the displayed text.
>
>>But your reply made me read further, and I think FntCharsInWidth 
>>would do the trick. 
>
>
> Odd: event FntCharsInWidth ignores tab, while the API Reference states
> this is specifically designed to draw field. But fields display tabs...

The function you want is FntLineWidth(). From the docs:
-------------------------------------------------------------------------------
Purpose

Gets the width of the specified line of text, taking tab characters into 
account. The function assumes that the characters passed are left-aligned 
and that the first character in the string is the first character drawn on 
a line. In other words, this routine doesn't work for characters that 
don't start at the beginning of a line.
-------------------------------------------------------------------------------
This is also used by the field drawing code.

HTH

Ton van Overbeek

-- 
For information on using the PalmSource Developer Forums, or to unsubscribe, 
please see http://www.palmos.com/dev/support/forums/

Reply via email to