Re: Setting the Line Height/ Line Spacing in an NSTextView.
Re: Setting the Line Height/ Line Spacing in an NSTextView.
- Subject: Re: Setting the Line Height/ Line Spacing in an NSTextView.
- From: Ross Carter <email@hidden>
- Date: Wed, 30 Dec 2009 11:12:18 -0500
On Dec 30, 2009, at 10:43 AM, Joshua Garnham wrote:
> How would I set the Line Height/ Line Spacinh in an NSTextView? e.g How
> tall each line is or how much space is between each line.
>
> Here's what I've tried (but doesn't work), it is in a NSTextView subclass …
> - (void)setDefaultParagraphStyle:(NSMutableParagraphStyle *)paragraphStyle {
> CGFloat spacing = 5.0f;
> [paragraphStyle setLineSpacing:spacing];
> [paragraphStyle setMinimumLineHeight:spacing];
> [paragraphStyle setMaximumLineHeight:spacing];
> }
>
> What's wrong with it?
A couple of things. First, the NSTextView method is - (void)setDefaultParagraphStyle:(NSParagraphStyle *)paragraphStyle. The argument is a regular NSParagraphStyle, not the mutable variety.
Second, rather than override - (void)setDefaultParagraphStyle:(NSParagraphStyle *)paragraphStyle, you simply use it as is. Construct your paragraphStyle elsewhere, and then send it to -setDefaultParagraphStyle:._______________________________________________
Cocoa-dev mailing list (email@hidden)
Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden