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

Re: string-width error?

In article <v01510107ab5d756e3455@[]>,
John_Gersh@aplmail.jhuapl.edu (John R. Gersh) wrote:

|I wrote:
|>A little testing reveals that string-width only uses the first 255
|>characters in its argument string to calculate the pixel width; any
|>characters beyond that are ignored. This is probably a reasonable limit for
|>most screen and font sizes, but it seems to be an undocumented one.
|I meant, of course, undocumented in the MCL docs. A little research in
|Inside Mac reveals that the _StringWidth toolbox call takes a str255
|argument. For those of us who use MCL to avoid dealing with the Mac
|infrastructure as much as possible, coming up against such limits may still
|be a bit of a surprise.

Using MCL as a buffer from the Mac infrastructure is an excellent
idea...in theory.

However, in practice, keep in mind the following:

eg:  (line-to self h v)   vs.      (#_LineTo h v)

Assuming each of the above is appearing in view-draw-contents, the latter
is *MUCH* faster and no more difficult to read/write.

Moral:  If you can quickly understand a trap call [both in writing and
later reading the code], use it.

-- "TANSTAAFL"  Rich lynch@ils.nwu.edu