Skip to content
Titanium SDK
Version12.6.3

You are reading 12.6.3. See this page in 13.4.1.

ParagraphAttribute

pseudoiPhoneiPadmacOSsince 7.5.0

An abstract datatype for specifying an Paragraph style attribute.

Attributes are added corresponding to value to create paragraph style, which when used with attributed string will give styled text.

Properties 13

A Boolean value indicating whether the system may tighten inter-character spacing before truncating text.

When this property is set to true, the system tries to reduce the space between characters before truncating characters. The system performs this tightening in cases where the text would not otherwise fit in the available space. The maximum amount of tightening performed by the system is dependent on the font, line width, and other factors. The default value of this property is false.

firstLineHeadIndent

Number | String

The indentation of the first line of the receiver.

This property contains the distance (in points) from the leading margin of a text container to the beginning of the first line of paragraph. This value is always nonnegative float value or dimension string (e.g. '10px').

headIndent

Number | String

The indentation of the lines of lines other than the first.

This property contains the distance (in points) from the leading margin of a text container to the beginning of lines other than the first. This value is always nonnegative float value or dimension string (e.g. '10px').

The threshold of paragraph for hyphenation.

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 hyphenation factor of paragraph is 0.0, the hyphenation factor of layout manager is used instead. When both are 0.0, hyphenation is disabled. This property detects the user-selected language by examining the first item in preferredLanguages.

The line height multiple.

The natural line height of the receiver is multiplied by this factor (if positive) before being constrained by minimum and maximum line height. The default value of this property is 0.0, which means nothing multiplied.

lineSpacing

Number | String

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

This value is always nonnegative float value or dimension string (e.g. '10px'). This value is included in the line fragment heights in the layout manager.

maximumLineHeight

Number | String

The maximum line height of receiver.

This property contains the maximum height in points that any line in the receiver will occupy, regardless of the font size or size of any attached graphic. This value is always nonnegative float value or dimension string (e.g. '10px'). The default value is 0. Glyphs and graphics exceeding this height will overlap neighboring lines; however, a maximum height of 0 implies no line height limit. Although this limit applies to the line itself, line spacing adds extra space between adjacent lines.

minimumLineHeight

Number | String

The minimum height of receiver.

This property contains the minimum height in points that any line in the receiver will occupy, regardless of the font size or size of any attached graphic. This value must be nonnegative float value or dimension string (e.g. '10px'). E.g. If you have set minimum height 30 and font size 10. It will make line height 30 which have smaller text size and more vertical sapcing between text.

paragraphSpacingAfter

Number | String

The space after the end of the paragraph.

This property contains the space (measured in points) added at the end of the paragraph to separate it from the following paragraph. This value must be nonnegative float value or dimension string (e.g. '10px'). The space between paragraphs is determined by adding the paragraphSpacingAfter of previous paragraph and the paragraphSpacingBefore of current paragraph.

paragraphSpacingBefore

Number | String

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

This property contains the space (measured in points) between the top of paragraph and the beginning of its text content. This value can be float value or dimension string (e.g. '10px'). The default value of this property is 0.0.

tailIndent

Number | String

The trailing indentation of the receiver.

If positive, this value is the distance (in points) from the leading margin (for example, the left margin in left-to-right text). If 0 or negative, it is the distance (in points) from the trailing margin. This is a float value or dimension string (e.g. '10px').