[Date Prev][Date Next][Thread Prev][Thread Next] [Search] [Date Index] [Thread Index]

[MacPerl] estimating printed width of some text



I have a question that the Toolbox gurus might be able to solve.

I would like to be able to make a good guess of the physical printed
width of some text, in a certain font, and for a certain font size. The
purpose is to use this in text wrapping routines. Just counting the
characters isn't good enough.

The straightforward way seems to me to compose a character width array,
and add up all the values found for each character in a string.

Is there a Toolbox call that might be used to fill this table?

There might even be a Toolbox call that will calculate the printed width
for the whole string. I know that Windows (even 3.1) has such an API
call. Is there an equivalent for the Mac?

Most important: can this be done in MacPerl?

More general question: what is the recommended way of converting source
code found in Inside Macintosch, into MacPerl calls?
	Bart.

***** Want to unsubscribe from this list?
***** Send mail with body "unsubscribe" to mac-perl-request@iis.ee.ethz.ch