• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: Setting the Line Height/ Line Spacing in an NSTextView.
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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

  • Follow-Ups:
    • Re: Setting the Line Height/ Line Spacing in an NSTextView.
      • From: Joshua Garnham <email@hidden>
References: 
 >Setting the Line Height/ Line Spacing in an NSTextView. (From: Joshua Garnham <email@hidden>)

  • Prev by Date: Re: Document-based application issue
  • Next by Date: Re: Setting the Line Height/ Line Spacing in an NSTextView.
  • Previous by thread: Setting the Line Height/ Line Spacing in an NSTextView.
  • Next by thread: Re: Setting the Line Height/ Line Spacing in an NSTextView.
  • Index(es):
    • Date
    • Thread