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
-
alignmentproperty -
firstLineHeadIndentproperty -
headIndentproperty -
tailIndentproperty -
lineBreakModeproperty -
maximumLineHeightproperty -
minimumLineHeightproperty -
lineSpacingproperty -
paragraphSpacingproperty -
paragraphSpacingBeforeproperty -
baseWritingDirectionproperty -
lineHeightMultipleproperty
Controlling Hyphenation and Truncation
-
hyphenationFactorproperty
Properties
alignment
The text alignment of the receiver.
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.hbaseWritingDirection
The base writing direction for the receiver.
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.hfirstLineHeadIndent
The indentation of the first line of the receiver.
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.
See Also
Declared In
NSParagraphStyle.hheadIndent
The indentation of the receiver’s lines other than the first.
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.hhyphenationFactor
The paragraph’s threshold for hyphenation.
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.hlineBreakMode
The mode that should be used to break lines in the receiver.
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.hlineHeightMultiple
The line height multiple.
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.hlineSpacing
The space between lines in the receiver (commonly known as leading).
Discussion
This property contains the space in points added between lines within the paragraph. This value must be nonnegative
Availability
- Available in iOS 6.0 and later.
Declared In
NSParagraphStyle.hmaximumLineHeight
The receiver’s maximum line height.
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.hminimumLineHeight
The receiver’s minimum height.
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.hparagraphSpacing
The space after the end of the paragraph.
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.hparagraphSpacingBefore
The distance between the paragraph’s top and the beginning of its text content.
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.
See Also
Declared In
NSParagraphStyle.htailIndent
The trailing indentation of the receiver.
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© 2012 Apple Inc. All Rights Reserved. (Last updated: 2012-09-19)