Important: The information in this document is obsolete and should not be used for new development.
Inherits from | |
Implements | |
Package | com.apple.cocoa.application |
Companion guide |
NSMutableParagraphStyle 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.
setParagraphStyle
setAlignment
setFirstLineHeadIndent
setHeadIndent
setTailIndent
setLineBreakMode
setMaximumLineHeight
setMinimumLineHeight
setLineSpacing
setParagraphSpacing
setBaseWritingDirection
setLineHeightMultiple
setParagraphSpacingBefore
setDefaultTabInterval
Creates an empty NSMutableParagraphStyle.
public NSMutableParagraphStyle
()
Adds tabStop to the receiver.
public void addTabStop
(NSTextTab tabStop)
removeTabStop
setTabStops
tabStops
(NSParagraphStyle)Removes the first text tab whose location and type are equal to those of tabStop.
public void removeTabStop
(NSTextTab tabStop)
addTabStop
setTabStops
tabStops
(NSParagraphStyle)Sets the alignment of the receiver to alignment.
public void setAlignment
(int alignment)
alignment may be one of:
NSText.LeftTextAlignment
NSText.RightTextAlignment
NSText.CenterTextAlignment
NSText.JustifiedTextAlignment
NSText.NaturalTextAlignment
alignment
(NSParagraphStyle)Sets the base writing direction for the receiver.
public void setBaseWritingDirection
(int writingDirection)
It can be WritingDirectionNaturalDirection
, WritingDirectionLeftToRight
, or WritingDirectionRightToLeft
. If you specify WritingDirectionNaturalDirection
, the receiver resolves the writing direction to either WritingDirectionLeftToRight
or WritingDirectionRightToLeft
, depending on the direction for the user’s language preference setting.
defaultWritingDirectionForLanguage
(NSParagraphStyle)baseWritingDirection
(NSParagraphStyle)Sets the default tab interval for the receiver.
public void setDefaultTabInterval
(float aFloat)
Tabs after the last specified in tabStops
are placed at integral multiples of this distance. This value must be nonnegative.
defaultTabInterval
(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.
public void setFirstLineHeadIndent
(float aFloat)
This value must be nonnegative.
setHeadIndent
setTailIndent
firstLineHeadIndent
(NSParagraphStyle)Specifies whether the paragraph is to be treated as a header for purposes of HTML generation.
public void setHeaderLevel
(int level)
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.
headerLevel
(NSParagraphStyle)Sets the distance in points from the leading margin of a text container to the beginning of lines other than the first to aFloat.
public void setHeadIndent
(float aFloat)
This value must be nonnegative.
setFirstLineHeadIndent
setTailIndent
headIndent
(NSParagraphStyle)Specifies the threshold for hyphenation.
public void setHyphenationFactor
(float aFactor)
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.
hyphenationFactor
(NSParagraphStyle)Sets the mode used to break lines in a layout container to mode.
public void setLineBreakMode
(int mode)
mode may be one of:
NSParagraphStyle.LineBreakByWordWrapping
NSParagraphStyle.LineBreakByCharWrapping
NSParagraphStyle.LineBreakByClipping
NSParagraphStyle.LineBreakByTruncatingHead
NSParagraphStyle.LineBreakByTruncatingTail
NSParagraphStyle.LineBreakByTruncatingMiddle
See the description of lineBreakMode
in the NSParagraphStyle class specification for descriptions of these values.
Sets the line height multiple for the receiver.
public void setLineHeightMultiple
(float aFloat)
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.
lineHeightMultiple
(NSParagraphStyle)Sets the space in points added between lines within the paragraph to aFloat.
public void setLineSpacing
(float aFloat)
This value must be nonnegative.
setMaximumLineHeight
setMinimumLineHeight
setParagraphSpacing
lineSpacing
(NSParagraphStyle)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.
public void setMaximumLineHeight
(float aFloat)
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.
setMinimumLineHeight
setLineSpacing
maximumLineHeight
(NSParagraphStyle)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.
public void setMinimumLineHeight
(float aFloat)
This value must be nonnegative.
setMaximumLineHeight
setLineSpacing
minimumLineHeight
(NSParagraphStyle)Sets the space added at the end of the paragraph to separate it from the following paragraph to aFloat.
public void setParagraphSpacing
(float aFloat)
This value must be nonnegative.
setLineSpacing
paragraphSpacing
(NSParagraphStyle)Sets the distance between the paragraph’s top and the beginning of its text content
public void setParagraphSpacingBefore
(float aFloat)
. This value must be nonnegative.
setParagraphSpacing
paragraphSpacingBefore
(NSParagraphStyle)Replaces the subattributes of the receiver with those in aStyle.
public void setParagraphStyle
(NSParagraphStyle aStyle)
Replaces the tab stops in the receiver with tabStops.
public void setTabStops
(NSArray tabStops)
addTabStop
removeTabStop
tabStops
(NSParagraphStyle)Sets the distance in points from the margin of a text container to the end of lines to aFloat.
public void setTailIndent
(float aFloat)
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.
setHeadIndent
setFirstLineHeadIndent
tailIndent
(NSParagraphStyle)Sets the text blocks containing the paragraph, nested from outermost to innermost to array.
public void setTextBlocks
(NSArray array)
textBlocks
(NSParagraphStyle)public void setTextLists
(NSArray array)
Sets the text lists containing the paragraph, nested from outermost to innermost, to array.
textLists
(NSParagraphStyle)Specifies the threshold for using tightening as an alternative to truncation.
public void setTighteningFactorForTruncation
(float aFactor)
When the line break mode specifies truncation, the text system attempts to tighten intercharacter 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. This method accepts positive and negative values, excluding 0. The default value is 0.05.
tighteningFactorForTruncation
(NSParagraphStyle)© 1997, 2007 Apple Inc. All Rights Reserved. (Last updated: 2007-02-01)