[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: string-width error?
- To: "John R. Gersh" <John_Gersh@aplmail.jhuapl.edu>
- Subject: Re: string-width error?
- From: Ernest T Rees <rees+@pitt.edu>
- Date: Tue, 7 Feb 1995 14:16:22 -0500 (EST)
- Cc: info-mcl@digitool.com
- In-reply-to: <v01510105ab5d53e953f5@[128.244.71.40]>
- Sender: owner-info-mcl@digitool.com
On Tue, 7 Feb 1995, John R. Gersh wrote:
> Peter Szolovits provided some useful code to size a bounding box for
> displaying text. This answers Peter Stone's problem in a practical sense,
> but his question of why
>
> >(string-width
> > "This adds new patterns and catalysts to a soup. A nil
> >material can be used if nothing is added.
> >This adds new patterns and catalysts to a soup. A nil
> >material can be used if nothing is added.
> >This adds new patterns and catalysts to a soup. A nil
> >material can be used if nothing is added.
> >This adds new patterns and catalysts to a soup. A nil
> >material can be used if nothing is added."
> > '("times" 12 :plain))
> >
> >=> 1164
>
> but
>
> >(string-width
> > "This adds new patterns and catalysts to a soup. A nil
> >material can be used if nothing is added.
> >This adds new patterns and catalysts to a soup. A nil
> >material can be used if nothing is added.
> >This adds new patterns and catalysts to a soup. A nil
> >material can be used if nothing is added."
> > '("times" 12 :plain))
> >
> >=> 1164
>
> remains.
>
> 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'll bet this is due to the underlying Mac datatype being limited to 255
bytes.