Mailing Lists: Apple Mailing Lists

Image of Mac OS face in stamp
 
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Text Sizing



From NSAttributedString additions in AppKit docs:

<Attachment missing>
Returns the bounding box of the marks that the receiver draws.

thus
[myAttributedString size].height

should give you the information you are looking for.

Just remember that if you are using NSAttributedString's -drawInRect:
method or -drawAtPoint:, these will not wrap your text. -drawInRect
will simply clip the text, in fact. If you are looking to have your
text wrap, you will need to use something else. (Perhaps an
NSTextField?)

Cheers,
-Charles

On Tuesday, July 31, 2001, at 05:18 PM, Clark S. Cox III wrote:

> I have not yet been able to find any documentation on how one
> would find out how much vertical space I would need to display a given
> NSAttributedString in a given width.
> That is, I have a NSAttributedString object that I am drawing with
> -drawInRect:. I know what width I want the rectangle to be, but I have
> no idea how high it should be, as the string is generated at run-time.
>
>
> --
> Clark S. Cox, III
> email@hidden
> http://www.whereismyhead.com/clark/
> _______________________________________________
> cocoa-dev mailing list
> email@hidden
> http://www.lists.apple.com/mailman/listinfo/cocoa-dev


References: 
 >Text Sizing (From: "Clark S. Cox III" <email@hidden>)



Visit the Apple Store online or at retail locations.
1-800-MY-APPLE

Contact Apple | Terms of Use | Privacy Policy

Copyright © 2007 Apple Inc. All rights reserved.