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

Re: string-width error?




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.