NSMutableParagraphStyle Class Reference

Inherits from
Conforms to
Framework
/System/Library/Frameworks/AppKit.framework
Availability
Available in iOS 6.0 and later.
Companion guide
Rulers and Paragraph Styles
Declared in
NSParagraphStyle.h

Overview

The NSMutableParagraphStyle class adds methods to its superclass, NSParagraphStyle, for changing the values of the subattributes in a paragraph style attribute. See the NSParagraphStyle and NSAttributedString specifications for more information.

Tasks

Setting Other Style Information

Accessing Tab Information

Controlling Hyphenation and Truncation

Properties

alignment

The text alignment of the receiver.

@property(readwrite) NSTextAlignment alignment
Discussion

Natural text alignment is realized as left or right alignment depending on the line sweep direction of the first script contained in the paragraph. For a list of alignment constants, see the “Constants” section of NSString UIKit Additions Reference.

Availability
  • Available in iOS 6.0 and later.
Declared In
NSParagraphStyle.h

baseWritingDirection

The base writing direction for the receiver.

@property(readwrite) NSWritingDirection baseWritingDirection
Discussion

If you specify NSWritingDirectionNaturalDirection, the receiver resolves the writing direction to either NSWritingDirectionLeftToRight or NSWritingDirectionRightToLeft, depending on the direction for the user’s language preference setting.

Availability
  • Available in iOS 6.0 and later.
Declared In
NSParagraphStyle.h

defaultTabInterval

The document-wide default tab interval.

@property(readonly,nonatomic) CGFloat defaultTabInterval
Discussion

This property represents the default tab interval in points. Tabs after the last specified in tabStops are placed at integer multiples of this distance (if positive). Default value is 0.0.

Availability
  • Available in iOS 7.0 and later.
See Also
Declared In
NSParagraphStyle.h

firstLineHeadIndent

The indentation of the first line of the receiver.

@property(readwrite) CGFloat firstLineHeadIndent
Discussion

This property contains the distance (in points) from the leading margin of a text container to the beginning of the paragraph’s first line. This value is always nonnegative.

Availability
  • Available in iOS 6.0 and later.
Declared In
NSParagraphStyle.h

headIndent

The indentation of the receiver’s lines other than the first.

@property(readwrite) CGFloat headIndent
Discussion

This property contains the distance (in points) from the leading margin of a text container to the beginning of lines other than the first. This value is always nonnegative.

Availability
  • Available in iOS 6.0 and later.
Declared In
NSParagraphStyle.h

hyphenationFactor

The paragraph’s threshold for hyphenation.

@property(readwrite) float hyphenationFactor
Discussion

Valid values lie between 0.0 and 1.0 inclusive. The default value is 0.0. Hyphenation is attempted when the ratio of the text width (as broken without hyphenation) to the width of the line fragment is less than the hyphenation factor. When the paragraph’s hyphenation factor is 0.0, the layout manager’s hyphenation factor is used instead. When both are 0.0, hyphenation is disabled.

Availability
  • Available in iOS 6.0 and later.
Declared In
NSParagraphStyle.h

lineBreakMode

The mode that should be used to break lines in the receiver.

@property(readwrite) NSLineBreakMode lineBreakMode
Discussion

This property contains the line break mode to be used laying out the paragraph’s text. For a list of line break constants, see the “Constants” section of NSParagraphStyle Class Reference.

Availability
  • Available in iOS 6.0 and later.
Declared In
NSParagraphStyle.h

lineHeightMultiple

The line height multiple.

@property(readwrite) CGFloat lineHeightMultiple
Discussion

The natural line height of the receiver is multiplied by this factor (if positive) before being constrained by minimum and maximum line height. The default value of this property is 0.0.

Availability
  • Available in iOS 6.0 and later.
Declared In
NSParagraphStyle.h

lineSpacing

The distance in points between the bottom of one line fragment and the top of the next.

@property(readwrite) CGFloat lineSpacing
Discussion

This value is always nonnegative. This value is included in the line fragment heights in the layout manager.

Availability
  • Available in iOS 6.0 and later.
Declared In
NSParagraphStyle.h

maximumLineHeight

The receiver’s maximum line height.

@property(readwrite) CGFloat maximumLineHeight
Discussion

This property contains the maximum height in points that any line in the receiver will occupy, regardless of the font size or size of any attached graphic. This value is always nonnegative. The default value is 0.

Glyphs and graphics exceeding this height will overlap neighboring lines; however, a maximum height of 0 implies no line height limit. Although this limit applies to the line itself, line spacing adds extra space between adjacent lines.

Availability
  • Available in iOS 6.0 and later.
Declared In
NSParagraphStyle.h

minimumLineHeight

The receiver’s minimum height.

@property(readwrite) CGFloat minimumLineHeight
Discussion

This property contains the minimum height in points that any line in the receiver will occupy, regardless of the font size or size of any attached graphic. This value must be nonnegative.

Availability
  • Available in iOS 6.0 and later.
Declared In
NSParagraphStyle.h

paragraphSpacing

The space after the end of the paragraph.

@property(readwrite) CGFloat paragraphSpacing
Discussion

This property contains the space (measured in points) added at the end of the paragraph to separate it from the following paragraph. This value must be nonnegative. The space between paragraphs is determined by adding the previous paragraph’s paragraphSpacing and the current paragraph’s paragraphSpacingBefore.

Availability
  • Available in iOS 6.0 and later.
Declared In
NSParagraphStyle.h

paragraphSpacingBefore

The distance between the paragraph’s top and the beginning of its text content.

@property(readwrite) CGFloat paragraphSpacingBefore
Discussion

This property contains the space (measured in points) between the paragraph’s top and the beginning of its text content. The default value of this property is 0.0.

Availability
  • Available in iOS 6.0 and later.
Declared In
NSParagraphStyle.h

tabStops

An array of NSTextTab objects representing the receiver’s tab stops.

@property(readonly,copy,nonatomic) NSArray *tabStops
Discussion

The NSTextTab objects, sorted by location, define the tab stops for the paragraph style. Default value is nil.

Availability
  • Available in iOS 7.0 and later.
Declared In
NSParagraphStyle.h

tailIndent

The trailing indentation of the receiver.

@property(readwrite) CGFloat tailIndent
Discussion

If positive, this value is the distance from the leading margin (for example, the left margin in left-to-right text). If 0 or negative, it’s the distance from the trailing margin.

For example, a paragraph style designed to fit exactly in a 2-inch wide container has a head indent of 0.0 and a tail indent of 0.0. One designed to fit with a quarter-inch margin has a head indent of 0.25 and a tail indent of –0.25.

Availability
  • Available in iOS 6.0 and later.
Declared In
NSParagraphStyle.h