Greg,

>The documentation for FntCharsInWidth() says, in part:
>
>"fitWithinWidth        TRUE is the string is considered
>truncated, FALSE if it isn't."
>
>Have I misunderstood something?  My results seem to
>indicate the exact opposite.

It's an error in the old documentation - I believe that it's been fixed up.

Note that FntCharsInWidth() is a pretty funky routine. It will return true
for the case where the string DOESN'T actually fit, but the last N
characters were all spaces or tabs.

Also note that independent of the value returned in fitWithinWidth, the
width & length returned by the routine will NOT include any trailing
spaces, tabs, or linefeed characters.

Basically FntCharsInWidth() is specifically designed to be used by the
field code, and thus you need to be pretty careful about how you use it.

A better option (available 3.1 or later) is FntWidthToOffset, which doesn't
do any special processing of trailing spaces, tabs, or linefeeds. Though
you do then need to ensure that there aren't any linefeeds in your string.

-- Ken

Ken Krugler
TransPac Software, Inc.
<http://www.transpac.com>
+1 530-470-9200 (direct) +1 408-261-7550 (main)


Reply via email to