Re: Text Sizing
Re: Text Sizing
- Subject: Re: Text Sizing
- From: Charles Jolley <email@hidden>
- Date: Tue, 31 Jul 2001 22:24:53 -0500
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>) |