The NSParagraph​Style class and its subclass NSMutable​Paragraph​Style encapsulate the paragraph or ruler attributes used by the NSAttributed​String classes. Instances of these classes are often referred to as paragraph style objects or, when no confusion will result, paragraph styles.


The mutable subclass of NSParagraph​Style is NSMutable​Paragraph​Style.


Creating an NSParagraphStyle

class var `default`:​ NSParagraph​Style

Returns the default paragraph style.

Accessing style information

var alignment:​ NSText​Alignment

The text alignment of the receiver.

var first​Line​Head​Indent:​ CGFloat

The indentation of the first line of the receiver.

var head​Indent:​ CGFloat

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

var tail​Indent:​ CGFloat

The trailing indentation of the receiver.

var maximum​Line​Height:​ CGFloat

The receiver’s maximum line height.

var minimum​Line​Height:​ CGFloat

The receiver’s minimum height.

var line​Spacing:​ CGFloat

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

var paragraph​Spacing:​ CGFloat

The space after the end of the paragraph.

var paragraph​Spacing​Before:​ CGFloat

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

Accessing Tab Information

var tab​Stops:​ [NSText​Tab]

An array of NSText​Tab objects representing the receiver’s tab stops.

var default​Tab​Interval:​ CGFloat

The document-wide default tab interval.

Getting text block and list information

var text​Blocks:​ [NSText​Block]

An array specifying the text blocks containing the paragraph.

var text​Lists:​ [NSText​List]

An array specifying the text lists containing the paragraph.

Getting line breaking information

var line​Break​Mode:​ NSLine​Break​Mode

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

var hyphenation​Factor:​ Float

The paragraph’s threshold for hyphenation.

var tightening​Factor​For​Truncation:​ Float

The threshold for using tightening as an alternative to truncation.

Getting HTML header level

var header​Level:​ Int

A boolean that specifies whether the paragraph is to be treated as a header for purposes of HTML generation.

Writing direction

class func default​Writing​Direction(for​Language:​ String?)

Returns the default writing direction for the specified language.

var base​Writing​Direction:​ NSWriting​Direction

The base writing direction for the receiver.



These constants specify what happens when a line is too long for its container.