About Paragraph Styles
NSParagraphStyle and its subclass NSMutableParagraphStyle encapsulate the paragraph or ruler attributes used by the NSAttributedString classes. Instances of these classes are often referred to as paragraph style objects, or when no confusion will result, as paragraph styles.
A paragraph style object represents a complex attribute value in an attributed string, storing a number of subattributes that affect paragraph layout for the characters of the string. Among these subattributes are alignment, tab stops, and indents. Figure 1 illustrates these and other paragraph style attributes.

These are the paragraph style attributes the text system uses:
alignmentis the text alignment. It isNSLeftTextAlignment,NSRightTextAlignment,NSCenterTextAlignment,NSJustifiedTextAlignment, orNSNaturalTextAlignment.firstLineHeadIndentis the distance in points from the leading margin of a text container to the beginning of the paragraph’s first line.headIndentis the distance in points from the leading margin of a text container to the beginning of lines other than the first.tailIndentis the distance in points from the margin of a text container to the end of lines.tabStopsis an array of NSTextTab objects, sorted by location, that define the tab stops for the paragraph style.lineBreakModeis the mode that should be used to break lines when laying out the paragraph's text. It can be one of the following:NSLineBreakByWordWrappingwraps at word boundaries.NSLineBreakByCharWrappingwraps at character boundaries.NSLineBreakByClippingclips lines past the edge of the text container.NSLineBreakByTruncatingHeaddisplays each line so that the end fits in the container and the missing text at the beginning is indicated by an ellipsis glyph.NSLineBreakByTruncatingTaildisplays each line so that the beginning fits in the container and the missing text at the end is indicated by an ellipsis glyph.NSLineBreakByTruncatingMiddledisplays each line so that the beginning and end both fit in the container and the missing text in the middle is indicated by an ellipsis glyph.
maximumLineHeightis the maximum height that any line in the receiver can occupy, regardless of the font size or size of any attached graphic.minimumLineHeightis the minimum height that any line in the receiver can occupy, regardless of the font size or size of any attached graphic.lineHeightMultipleis a factor by which the default line height (a metric of the font) is multiplied before being constrained by minimum and maximum line height.lineSpacingis extra space in points added between lines within the paragraph.paragraphSpacingis space in points added at the end of the paragraph to separate it from the following paragraph.paragraphSpacingBeforeis space in points added between the top of the paragraph and the beginning of its text content.
Copyright © 1997, 2007 Apple Inc. All Rights Reserved. Terms of Use | Privacy Policy | Updated: 2007-09-04