Text height for printing (fixed width)
Text height for printing (fixed width)
- Subject: Text height for printing (fixed width)
- From: Jérôme Jaglale <email@hidden>
- Date: Tue, 3 Jan 2006 11:13:07 +0400
I have a NSString s, a NSFont f, a width w (float) and I want the height of
s in f font in a rect of width w. It could (very often) have more than one
line (because of "true" line breaks or lines too long).
I've tried 2 methods :
- one from Apple Text NSLayout Programming Guide
- one from a Matt Neuburg post in MacOSX-dev mailing-list
They both seems to give wrong results : more there are lines, too smaller is
the height returned.
I've written a small app for this problem : there is a NSTextView and a
custom view which simulates printing. You can try the two methods above.
http://www.maestric.com/shared/cocoa/NSTextViewPrinting.zip
Am I wrong somewhere ?
Thanks.
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Cocoa-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden