Re: Making NSTextView draw like NSString's -drawInRect:withAttributes:?
Re: Making NSTextView draw like NSString's -drawInRect:withAttributes:?
- Subject: Re: Making NSTextView draw like NSString's -drawInRect:withAttributes:?
- From: Douglas Davidson <email@hidden>
- Date: Thu, 16 Feb 2006 10:00:29 -0800
On Feb 16, 2006, at 9:55 AM, Keith Blount wrote:
I have a custom view which draws various boxes of text
using NSString's -drawInRect:withAttributes:. I am
currently improving this view so that each box is
editable. This part isn't too difficult - I just add
an NSTextView as a subview at the location of the
edited box when a box is double-clicked.
My problem is that no matter what I do, I cannot get
the text as it is drawn in the text view to match the
text as it is drawn by NSString's methods. In the text
view, each line of text is about 1 pixel smaller than
when it is drawn by NSString. (I have called
-setLineFragmentPadding: on the text container and set
it to 0.0 so that it matches horizontally). I have
tried everything I can think of, including using
paragraph attributes such as setMinimumLineSpacing:
(though I want the text view as plain text), and
setting the text view as the field editor using
-setFieldEditor:YES.
Look for Aki's recent post on NSTypesetterBehavior settings, and try
that.
Douglas Davidson
_______________________________________________
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