Mac Developer Library

Developer

AppKit Framework Reference NSMutableParagraphStyle Class Reference

Options
Deployment Target:

On This Page
Language:

NSMutableParagraphStyle

Inheritance


Import Statement


Swift

import AppKit

Objective-C

@import AppKit;

Availability


Available in OS X v10.0 and later.

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.

  • Replaces the subattributes of the receiver with those in the specified paragraph style object.

    Declaration

    Swift

    func setParagraphStyle(_ obj: NSParagraphStyle)

    Objective-C

    - (void)setParagraphStyle:(NSParagraphStyle *)obj

    Import Statement

    Objective-C

    @import AppKit;

    Swift

    import AppKit

    Availability

    Available in OS X v10.0 and later.

  • Sets the alignment of the receiver to alignment.

    Declaration

    Swift

    var alignment: NSTextAlignment

    Objective-C

    @property NSTextAlignment alignment

    Discussion

    alignment may be one of:

    • NSLeftTextAlignment

    • NSRightTextAlignment

    • NSCenterTextAlignment

    • NSJustifiedTextAlignment

    • NSNaturalTextAlignment

    Import Statement

    Objective-C

    @import AppKit;

    Swift

    import AppKit

    Availability

    Available in OS X v10.0 and later.

    See Also

    alignment (NSParagraphStyle)

  • Sets the distance in points from the leading margin of a text container to the beginning of the paragraph’s first line to aFloat.

    Declaration

    Swift

    var firstLineHeadIndent: CGFloat

    Objective-C

    @property CGFloat firstLineHeadIndent

    Discussion

    This value must be nonnegative.

    Import Statement

    Objective-C

    @import AppKit;

    Swift

    import AppKit

    Availability

    Available in OS X v10.0 and later.

  • Sets the distance in points from the leading margin of a text container to the beginning of lines other than the first to aFloat.

    Declaration

    Swift

    var headIndent: CGFloat

    Objective-C

    @property CGFloat headIndent

    Discussion

    This value must be nonnegative.

    Import Statement

    Objective-C

    @import AppKit;

    Swift

    import AppKit

    Availability

    Available in OS X v10.0 and later.

  • Sets the distance in points from the margin of a text container to the end of lines to aFloat.

    Declaration

    Swift

    var tailIndent: CGFloat

    Objective-C

    @property CGFloat tailIndent

    Discussion

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

    For example, to create a paragraph style that fits exactly in a 2-inch wide container, set its head indent to 0.0 and its tail indent to 0.0. To create a paragraph style with quarter-inch margins, set its head indent to 0.25 and its tail indent to –0.25.

    Import Statement

    Objective-C

    @import AppKit;

    Swift

    import AppKit

    Availability

    Available in OS X v10.0 and later.

  • Sets the mode used to break lines in a layout container to mode.

    Declaration

    Swift

    var lineBreakMode: NSLineBreakMode

    Objective-C

    @property NSLineBreakMode lineBreakMode

    Discussion

    For a list of line break constants, see the “Constants” section of NSParagraphStyle Class Reference.

    Import Statement

    Objective-C

    @import AppKit;

    Swift

    import AppKit

    Availability

    Available in OS X v10.0 and later.

  • Sets the maximum height that any line in the paragraph style will occupy, regardless of the font size or size of any attached graphic, to aFloat.

    Declaration

    Swift

    var maximumLineHeight: CGFloat

    Objective-C

    @property CGFloat maximumLineHeight

    Discussion

    Glyphs and graphics exceeding this height will overlap neighboring lines; however, a maximum height of 0 implies no line height limit. This value must be nonnegative.

    Although this limit applies to the line itself, line spacing adds extra space between adjacent lines.

    Import Statement

    Objective-C

    @import AppKit;

    Swift

    import AppKit

    Availability

    Available in OS X v10.0 and later.

  • Sets the minimum height that any line in the paragraph style will occupy, regardless of the font size or size of any attached graphic, to aFloat.

    Declaration

    Swift

    var minimumLineHeight: CGFloat

    Objective-C

    @property CGFloat minimumLineHeight

    Discussion

    This value must be nonnegative.

    Import Statement

    Objective-C

    @import AppKit;

    Swift

    import AppKit

    Availability

    Available in OS X v10.0 and later.

  • Sets the distance in points added between lines within the paragraph to aFloat.

    Declaration

    Swift

    var lineSpacing: CGFloat

    Objective-C

    @property CGFloat lineSpacing

    Discussion

    This value must be nonnegative.

    Import Statement

    Objective-C

    @import AppKit;

    Swift

    import AppKit

    Availability

    Available in OS X v10.0 and later.

  • Sets the space added at the end of the paragraph to separate it from the following paragraph to aFloat.

    Declaration

    Swift

    var paragraphSpacing: CGFloat

    Objective-C

    @property CGFloat paragraphSpacing

    Discussion

    This value must be nonnegative.

    Import Statement

    Objective-C

    @import AppKit;

    Swift

    import AppKit

    Availability

    Available in OS X v10.0 and later.

  • Sets the distance between the paragraph’s top and the beginning of its text content

    Declaration

    Swift

    var paragraphSpacingBefore: CGFloat

    Objective-C

    @property CGFloat paragraphSpacingBefore

    Discussion

    . This value must be nonnegative.

    Import Statement

    Objective-C

    @import AppKit;

    Swift

    import AppKit

    Availability

    Available in OS X v10.3 and later.

  • Sets the base writing direction for the receiver.

    Declaration

    Swift

    var baseWritingDirection: NSWritingDirection

    Objective-C

    @property NSWritingDirection baseWritingDirection

    Discussion

    It can be NSWritingDirectionNaturalDirection, NSWritingDirectionLeftToRight, or NSWritingDirectionRightToLeft. 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.

    Import Statement

    Objective-C

    @import AppKit;

    Swift

    import AppKit

    Availability

    Available in OS X v10.2 and later.

    See Also

    defaultWritingDirectionForLanguage: (NSParagraphStyle)
    baseWritingDirection (NSParagraphStyle)

  • Sets the line height multiple for the receiver.

    Declaration

    Swift

    var lineHeightMultiple: CGFloat

    Objective-C

    @property CGFloat lineHeightMultiple

    Discussion

    The natural line height of the receiver is multiplied by this factor before being constrained by minimum and maximum line height. This value must be nonnegative.

    Import Statement

    Objective-C

    @import AppKit;

    Swift

    import AppKit

    Availability

    Available in OS X v10.3 and later.

    See Also

    lineHeightMultiple (NSParagraphStyle)

  • Replaces the tab stops in the receiver with tabStops.

    Declaration

    Swift

    var tabStops: [AnyObject]?

    Objective-C

    @property(copy) NSArray *tabStops

    Import Statement

    Objective-C

    @import AppKit;

    Swift

    import AppKit

    Availability

    Available in OS X v10.0 and later.

    See Also

    – addTabStop:
    – removeTabStop:
    tabStops (NSParagraphStyle)

  • Adds tabStop to the receiver.

    Declaration

    Swift

    func addTabStop(_ anObject: NSTextTab)

    Objective-C

    - (void)addTabStop:(NSTextTab *)anObject

    Import Statement

    Objective-C

    @import AppKit;

    Swift

    import AppKit

    Availability

    Available in OS X v10.0 and later.

    See Also

    – removeTabStop:
    – setTabStops:
    tabStops (NSParagraphStyle)

  • Removes the first text tab whose location and type are equal to those of tabStop.

    Declaration

    Swift

    func removeTabStop(_ anObject: NSTextTab)

    Objective-C

    - (void)removeTabStop:(NSTextTab *)anObject

    Import Statement

    Objective-C

    @import AppKit;

    Swift

    import AppKit

    Availability

    Available in OS X v10.0 and later.

    See Also

    – addTabStop:
    – setTabStops:
    tabStops (NSParagraphStyle)

  • Sets the default tab interval for the receiver.

    Declaration

    Swift

    var defaultTabInterval: CGFloat

    Objective-C

    @property CGFloat defaultTabInterval

    Discussion

    Tabs after the last specified in tabStops are placed at integral multiples of this distance. This value must be nonnegative.

    Import Statement

    Objective-C

    @import AppKit;

    Swift

    import AppKit

    Availability

    Available in OS X v10.3 and later.

    See Also

    defaultTabInterval (NSParagraphStyle)

  • Sets the text blocks containing the paragraph, nested from outermost to innermost to array.

    Declaration

    Swift

    var textBlocks: [AnyObject]?

    Objective-C

    @property(copy) NSArray *textBlocks

    Import Statement

    Objective-C

    @import AppKit;

    Swift

    import AppKit

    Availability

    Available in OS X v10.4 and later.

  • Sets the array of text lists containing the paragraph.

    Declaration

    Swift

    var textLists: [AnyObject]?

    Objective-C

    @property(copy) NSArray *textLists

    Discussion

    Sets the text lists containing the paragraph, nested from outermost to innermost, to array.

    Import Statement

    Objective-C

    @import AppKit;

    Swift

    import AppKit

    Availability

    Available in OS X v10.4 and later.

  • Specifies the paragraph’s threshold for hyphenation.

    Declaration

    Swift

    var hyphenationFactor: Float

    Objective-C

    @property 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.

    Import Statement

    Objective-C

    @import AppKit;

    Swift

    import AppKit

    Availability

    Available in OS X v10.4 and later.

  • Specifies the threshold for using tightening as an alternative to truncation.

    Declaration

    Swift

    var tighteningFactorForTruncation: Float

    Objective-C

    @property float tighteningFactorForTruncation

    Discussion

    When the line break mode specifies truncation, the text system attempts to tighten inter character spacing as an alternative to truncation, provided that the ratio of the text width to the line fragment width does not exceed 1.0 + the value returned by tighteningFactorForTruncation. Otherwise the text is truncated at a location determined by the line break mode. The default value is 0.05. This method accepts positive and negative values. Values less than or equal to 0.0 result in not tightening.

    Import Statement

    Objective-C

    @import AppKit;

    Swift

    import AppKit

    Availability

    Available in OS X v10.4 and later.

    See Also

    tighteningFactorForTruncation (NSParagraphStyle)

  • Specifies whether the paragraph is to be treated as a header for purposes of HTML generation.

    Declaration

    Swift

    var headerLevel: Int

    Objective-C

    @property NSInteger headerLevel

    Discussion

    Should be set to 0 (the default value) if the paragraph is not a header, or from 1 through 6 if the paragraph is to be treated as a header.

    Import Statement

    Objective-C

    @import AppKit;

    Swift

    import AppKit

    Availability

    Available in OS X v10.4 and later.

    See Also

    headerLevel (NSParagraphStyle)