Class ParagraphStyle

ParagraphStyle

The styles of text that apply to entire paragraphs.

Read methods in this class return null if the corresponding TextRange spans multiple paragraphs, and those paragraphs have different values for the read method being called. To avoid this, query for paragraph styles using the TextRange returned by the Paragraph.getRange() method.

Methods

MethodReturn typeBrief description
getIndentEnd()NumberReturns the text end indentation for paragraphs in the TextRange in points, or null if there are multiple paragraph styles on the given text.
getIndentFirstLine()NumberReturns the indentation for the first line of paragraphs in the TextRange in points, or null if there are multiple paragraph styles on the given text.
getIndentStart()NumberReturns the text start indentation for paragraphs in the TextRange in points, or null if there are multiple paragraph styles on the given text.
getLineSpacing()NumberReturns the line spacing, or null if there are multiple paragraph styles on the given text.
getParagraphAlignment()ParagraphAlignmentReturns the ParagraphAlignment of paragraphs in the TextRange, or null if there are multiple paragraph styles on the given text.
getSpaceAbove()NumberReturns the extra space above paragraphs in the TextRange in points, or null if there are multiple paragraph styles on the given text.
getSpaceBelow()NumberReturns the extra space below paragraphs in the TextRange in points, or null if there are multiple paragraph styles on the given text.
getSpacingMode()SpacingModeReturns the SpacingMode for paragraphs in the TextRange, or null if there are multiple paragraph styles on the given text.
getTextDirection()TextDirectionReturns the TextDirection for paragraphs in the TextRange, or null if there are multiple paragraph styles on the given text.
setIndentEnd(indent)ParagraphStyleSets the text end indentation for paragraphs in the TextRange in points.
setIndentFirstLine(indent)ParagraphStyleSets the indentation for the first line of paragraphs in the TextRange in points.
setIndentStart(indent)ParagraphStyleSets the text start indentation for paragraphs in the TextRange in points.
setLineSpacing(spacing)ParagraphStyleSets the line spacing.
setParagraphAlignment(alignment)ParagraphStyleSets the ParagraphAlignment of paragraphs in the TextRange.
setSpaceAbove(space)ParagraphStyleSets the extra space above paragraphs in the TextRange in points.
setSpaceBelow(space)ParagraphStyleSets the extra space below paragraphs in the TextRange in points.
setSpacingMode(mode)ParagraphStyleSets the SpacingMode for paragraphs in the TextRange.
setTextDirection(direction)ParagraphStyleSets the TextDirection for paragraphs in the TextRange.

Detailed documentation

getIndentEnd()

Returns the text end indentation for paragraphs in the TextRange in points, or null if there are multiple paragraph styles on the given text.

The side that corresponds to the end of the text is based on the current text direction.

Return

Number


getIndentFirstLine()

Returns the indentation for the first line of paragraphs in the TextRange in points, or null if there are multiple paragraph styles on the given text.

Return

Number


getIndentStart()

Returns the text start indentation for paragraphs in the TextRange in points, or null if there are multiple paragraph styles on the given text.

The side that corresponds to the start of the text is based on the current text direction.

Return

Number


getLineSpacing()

Returns the line spacing, or null if there are multiple paragraph styles on the given text.

This is a value that corresponds to the space between lines, as a percentage of normal. Normal is represented as 100.0.

Return

Number


getParagraphAlignment()

Returns the ParagraphAlignment of paragraphs in the TextRange, or null if there are multiple paragraph styles on the given text.

Return

ParagraphAlignment


getSpaceAbove()

Returns the extra space above paragraphs in the TextRange in points, or null if there are multiple paragraph styles on the given text.

Return

Number


getSpaceBelow()

Returns the extra space below paragraphs in the TextRange in points, or null if there are multiple paragraph styles on the given text.

Return

Number


getSpacingMode()

Returns the SpacingMode for paragraphs in the TextRange, or null if there are multiple paragraph styles on the given text.

Return

SpacingMode


getTextDirection()

Returns the TextDirection for paragraphs in the TextRange, or null if there are multiple paragraph styles on the given text.

Return

TextDirection


setIndentEnd(indent)

Sets the text end indentation for paragraphs in the TextRange in points.

The side that corresponds to the end of the text is based on the current text direction.

Parameters

NameTypeDescription
indentNumber

Return

ParagraphStyle


setIndentFirstLine(indent)

Sets the indentation for the first line of paragraphs in the TextRange in points.

Parameters

NameTypeDescription
indentNumber

Return

ParagraphStyle


setIndentStart(indent)

Sets the text start indentation for paragraphs in the TextRange in points.

The side that corresponds to the start of the text is based on the current text direction.

Parameters

NameTypeDescription
indentNumber

Return

ParagraphStyle


setLineSpacing(spacing)

Sets the line spacing.

This is a value that corresponds to the space between lines, as a percentage of normal. Normal is represented as 100.0.

Parameters

NameTypeDescription
spacingNumber

Return

ParagraphStyle


setParagraphAlignment(alignment)

Sets the ParagraphAlignment of paragraphs in the TextRange.

Parameters

NameTypeDescription
alignmentParagraphAlignment

Return

ParagraphStyle


setSpaceAbove(space)

Sets the extra space above paragraphs in the TextRange in points.

Parameters

NameTypeDescription
spaceNumber

Return

ParagraphStyle


setSpaceBelow(space)

Sets the extra space below paragraphs in the TextRange in points.

Parameters

NameTypeDescription
spaceNumber

Return

ParagraphStyle


setSpacingMode(mode)

Sets the SpacingMode for paragraphs in the TextRange.

Parameters

NameTypeDescription
modeSpacingMode

Return

ParagraphStyle


setTextDirection(direction)

Sets the TextDirection for paragraphs in the TextRange.

Parameters

NameTypeDescription
directionTextDirection

Return

ParagraphStyle

Send feedback about...

Apps Script
Apps Script