Next Page > Hide TOC

Legacy Documentclose button

Important: The information in this document is obsolete and should not be used for new development.

NSMutableParagraphStyle

Inherits from
Implements
Package
com.apple.cocoa.application
Companion guide

Overview

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.

Tasks

Constructors

Setting Tab Stops

Setting Other Style Information

Setting Text Blocks and Lists

Controlling Hyphenation and Truncation

Setting HTML Header Level

Constructors

NSMutableParagraphStyle

Creates an empty NSMutableParagraphStyle.

public NSMutableParagraphStyle()

Instance Methods

addTabStop

Adds tabStop to the receiver.

public void addTabStop(NSTextTab tabStop)

See Also

removeTabStop

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

public void removeTabStop(NSTextTab tabStop)

See Also

setAlignment

Sets the alignment of the receiver to alignment.

public void setAlignment(int alignment)

Discussion

alignment may be one of:

See Also

setBaseWritingDirection

Sets the base writing direction for the receiver.

public void setBaseWritingDirection(int writingDirection)

Discussion

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.

Availability
See Also

setDefaultTabInterval

Sets the default tab interval for the receiver.

public void setDefaultTabInterval(float aFloat)

Discussion

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

Availability
See Also

setFirstLineHeadIndent

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)

Discussion

This value must be nonnegative.

See Also

setHeaderLevel

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

public void setHeaderLevel(int level)

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.

Availability
See Also

setHeadIndent

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)

Discussion

This value must be nonnegative.

See Also

setHyphenationFactor

Specifies the threshold for hyphenation.

public void setHyphenationFactor(float aFactor)

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
See Also

setLineBreakMode

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

public void setLineBreakMode(int mode)

Discussion

mode may be one of:

See the description of lineBreakMode in the NSParagraphStyle class specification for descriptions of these values.

setLineHeightMultiple

Sets the line height multiple for the receiver.

public void setLineHeightMultiple(float aFloat)

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.

Availability
See Also

setLineSpacing

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

public void setLineSpacing(float aFloat)

Discussion

This value must be nonnegative.

See Also

setMaximumLineHeight

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)

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.

See Also

setMinimumLineHeight

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)

Discussion

This value must be nonnegative.

See Also

setParagraphSpacing

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

public void setParagraphSpacing(float aFloat)

Discussion

This value must be nonnegative.

See Also

setParagraphSpacingBefore

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

public void setParagraphSpacingBefore(float aFloat)

Discussion

. This value must be nonnegative.

Availability
See Also

setParagraphStyle

Replaces the subattributes of the receiver with those in aStyle.

public void setParagraphStyle(NSParagraphStyle aStyle)

setTabStops

Replaces the tab stops in the receiver with tabStops.

public void setTabStops(NSArray tabStops)

See Also

setTailIndent

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

public void setTailIndent(float aFloat)

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.

See Also

setTextBlocks

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

public void setTextBlocks(NSArray array)

Availability
See Also

setTextLists

public void setTextLists(NSArray array)

Discussion

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

Availability
See Also

setTighteningFactorForTruncation

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

public void setTighteningFactorForTruncation(float aFactor)

Discussion

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.

Availability
See Also


Next Page > Hide TOC


© 1997, 2007 Apple Inc. All Rights Reserved. (Last updated: 2007-02-01)


Did this document help you?
Yes: Tell us what works for you.
It’s good, but: Report typos, inaccuracies, and so forth.
It wasn’t helpful: Tell us what would have helped.