Class ParagraphStyle

ParagraphStyle

段落全体に適用されるテキストのスタイル。

このクラスの読み取りメソッドは、対応する TextRange が複数の段落にまたがっており、それらの段落の呼び出される読み取りメソッドの値が異なる場合、null を返します。これを回避するには、Paragraph.getRange() メソッドから返された TextRange を使用して段落スタイルをクエリします。

テキストが図形内に収まるように編集する方法を使用すると、段落スタイルに適用されている自動調整の設定は無効になります。

メソッド

メソッド戻り値の型概要
getIndentEnd()Number|nullTextRange の段落のテキスト末尾のインデントをポイント単位で返します。指定されたテキストに複数の段落スタイルがある場合は、null を返します。
getIndentFirstLine()Number|nullTextRange の段落の 1 行目のインデントをポイント単位で返します。指定されたテキストに複数の段落スタイルがある場合は null を返します。
getIndentStart()Number|nullTextRange の段落のテキストの開始インデントをポイント単位で返します。指定されたテキストに複数の段落スタイルがある場合は null を返します。
getLineSpacing()Number|null行間を返します。指定されたテキストに複数の段落スタイルがある場合は null を返します。
getParagraphAlignment()ParagraphAlignment|null指定されたテキストに複数の段落スタイルがある場合は、TextRange の段落の ParagraphAlignment、または null を返します。
getSpaceAbove()Number|nullTextRange の段落の上にある余白をポイント単位で返します。指定されたテキストに複数の段落スタイルがある場合は null を返します。
getSpaceBelow()Number|nullTextRange の段落の下の余白をポイント単位で返します。指定されたテキストに複数の段落スタイルがある場合は、null を返します。
getSpacingMode()SpacingMode|nullTextRange の段落の SpacingMode を返します。指定されたテキストに複数の段落スタイルがある場合は null を返します。
getTextDirection()TextDirection|nullTextRange の段落の TextDirection を返します。指定されたテキストに複数の段落スタイルがある場合は null を返します。
setIndentEnd(indent)ParagraphStyleTextRange の段落のテキスト末尾インデントをポイント単位で設定します。
setIndentFirstLine(indent)ParagraphStyleTextRange の段落の 1 行目のインデントをポイント単位で設定します。
setIndentStart(indent)ParagraphStyleTextRange の段落のテキストの開始インデントをポイント単位で設定します。
setLineSpacing(spacing)ParagraphStyle行間隔を設定します。
setParagraphAlignment(alignment)ParagraphStyleTextRange の段落の ParagraphAlignment を設定します。
setSpaceAbove(space)ParagraphStyleTextRange の段落の上の余白をポイント単位で設定します。
setSpaceBelow(space)ParagraphStyleTextRange の段落の下の余白をポイント単位で設定します。
setSpacingMode(mode)ParagraphStyleTextRange の段落の SpacingMode を設定します。
setTextDirection(direction)ParagraphStyleTextRange の段落の TextDirection を設定します。

詳細なドキュメント

getIndentEnd()

TextRange の段落のテキスト末尾のインデントをポイント単位で返します。指定されたテキストに複数の段落スタイルがある場合は、null を返します。

テキストの末尾に対応する側は、現在のテキストの方向に基づきます。

戻る

Number|null

承認

このメソッドを使用するスクリプトには、次の 1 つ以上のスコープによる承認が必要です。

  • https://www.googleapis.com/auth/presentations.currentonly
  • https://www.googleapis.com/auth/presentations

getIndentFirstLine()

TextRange の段落の 1 行目のインデントをポイント単位で返します。指定されたテキストに複数の段落スタイルがある場合は null を返します。

戻る

Number|null

承認

このメソッドを使用するスクリプトには、次の 1 つ以上のスコープによる承認が必要です。

  • https://www.googleapis.com/auth/presentations.currentonly
  • https://www.googleapis.com/auth/presentations

getIndentStart()

TextRange の段落のテキストの開始インデントをポイント単位で返します。指定されたテキストに複数の段落スタイルがある場合は null を返します。

テキストの先頭に対応する側は、現在のテキストの方向に基づきます。

戻る

Number|null

承認

このメソッドを使用するスクリプトには、次の 1 つ以上のスコープによる承認が必要です。

  • https://www.googleapis.com/auth/presentations.currentonly
  • https://www.googleapis.com/auth/presentations

getLineSpacing()

行間を返します。指定されたテキストに複数の段落スタイルがある場合は null を返します。

これは、行間の値を通常の割合で表したものです。通常は 100.0 で表されます。

戻る

Number|null

承認

このメソッドを使用するスクリプトには、次の 1 つ以上のスコープによる承認が必要です。

  • https://www.googleapis.com/auth/presentations.currentonly
  • https://www.googleapis.com/auth/presentations

getParagraphAlignment()

指定されたテキストに複数の段落スタイルがある場合は、TextRange の段落の ParagraphAlignment、または null を返します。

戻る

ParagraphAlignment|null

承認

このメソッドを使用するスクリプトには、次の 1 つ以上のスコープによる承認が必要です。

  • https://www.googleapis.com/auth/presentations.currentonly
  • https://www.googleapis.com/auth/presentations

getSpaceAbove()

TextRange の段落の上にある余白をポイント単位で返します。指定されたテキストに複数の段落スタイルがある場合は null を返します。

戻る

Number|null

承認

このメソッドを使用するスクリプトには、次の 1 つ以上のスコープによる承認が必要です。

  • https://www.googleapis.com/auth/presentations.currentonly
  • https://www.googleapis.com/auth/presentations

getSpaceBelow()

TextRange の段落の下の余白をポイント単位で返します。指定されたテキストに複数の段落スタイルがある場合は、null を返します。

戻る

Number|null

承認

このメソッドを使用するスクリプトには、次の 1 つ以上のスコープによる承認が必要です。

  • https://www.googleapis.com/auth/presentations.currentonly
  • https://www.googleapis.com/auth/presentations

getSpacingMode()

TextRange の段落の SpacingMode を返します。指定されたテキストに複数の段落スタイルがある場合は null を返します。

戻る

SpacingMode|null

承認

このメソッドを使用するスクリプトには、次の 1 つ以上のスコープによる承認が必要です。

  • https://www.googleapis.com/auth/presentations.currentonly
  • https://www.googleapis.com/auth/presentations

getTextDirection()

TextRange の段落の TextDirection を返します。指定されたテキストに複数の段落スタイルがある場合は null を返します。

戻る

TextDirection|null

承認

このメソッドを使用するスクリプトには、次の 1 つ以上のスコープによる承認が必要です。

  • https://www.googleapis.com/auth/presentations.currentonly
  • https://www.googleapis.com/auth/presentations

setIndentEnd(indent)

TextRange の段落のテキスト末尾のインデントをポイント単位で設定します。

テキストの末尾に対応する側は、現在のテキストの方向に基づきます。

パラメータ

名前説明
indentNumber

戻る

ParagraphStyle

承認

このメソッドを使用するスクリプトには、次の 1 つ以上のスコープによる承認が必要です。

  • https://www.googleapis.com/auth/presentations.currentonly
  • https://www.googleapis.com/auth/presentations

setIndentFirstLine(indent)

TextRange の段落の 1 行目のインデントをポイント単位で設定します。

パラメータ

名前説明
indentNumber

戻る

ParagraphStyle

承認

このメソッドを使用するスクリプトには、次の 1 つ以上のスコープによる承認が必要です。

  • https://www.googleapis.com/auth/presentations.currentonly
  • https://www.googleapis.com/auth/presentations

setIndentStart(indent)

TextRange の段落のテキストの開始インデントをポイント単位で設定します。

テキストの先頭に対応する側は、現在のテキストの方向に基づきます。

パラメータ

名前説明
indentNumber

戻る

ParagraphStyle

承認

このメソッドを使用するスクリプトには、次の 1 つ以上のスコープによる承認が必要です。

  • https://www.googleapis.com/auth/presentations.currentonly
  • https://www.googleapis.com/auth/presentations

setLineSpacing(spacing)

行間隔を設定します。

これは、行間の値を通常の割合で表したものです。通常は 100.0 で表されます。

パラメータ

名前説明
spacingNumber

戻る

ParagraphStyle

承認

このメソッドを使用するスクリプトには、次の 1 つ以上のスコープによる承認が必要です。

  • https://www.googleapis.com/auth/presentations.currentonly
  • https://www.googleapis.com/auth/presentations

setParagraphAlignment(alignment)

TextRange の段落の ParagraphAlignment を設定します。

パラメータ

名前説明
alignmentParagraphAlignment

戻る

ParagraphStyle

承認

このメソッドを使用するスクリプトには、次の 1 つ以上のスコープによる承認が必要です。

  • https://www.googleapis.com/auth/presentations.currentonly
  • https://www.googleapis.com/auth/presentations

setSpaceAbove(space)

TextRange の段落の上の余白をポイント単位で設定します。

パラメータ

名前説明
spaceNumber

戻る

ParagraphStyle

承認

このメソッドを使用するスクリプトには、次の 1 つ以上のスコープによる承認が必要です。

  • https://www.googleapis.com/auth/presentations.currentonly
  • https://www.googleapis.com/auth/presentations

setSpaceBelow(space)

TextRange の段落の下の余白をポイント単位で設定します。

パラメータ

名前説明
spaceNumber

戻る

ParagraphStyle

承認

このメソッドを使用するスクリプトには、次の 1 つ以上のスコープによる承認が必要です。

  • https://www.googleapis.com/auth/presentations.currentonly
  • https://www.googleapis.com/auth/presentations

setSpacingMode(mode)

TextRange の段落の SpacingMode を設定します。

パラメータ

名前説明
modeSpacingMode

戻る

ParagraphStyle

承認

このメソッドを使用するスクリプトには、次の 1 つ以上のスコープによる承認が必要です。

  • https://www.googleapis.com/auth/presentations.currentonly
  • https://www.googleapis.com/auth/presentations

setTextDirection(direction)

TextRange の段落の TextDirection を設定します。

パラメータ

名前説明
directionTextDirection

戻る

ParagraphStyle

承認

このメソッドを使用するスクリプトには、次の 1 つ以上のスコープによる承認が必要です。

  • https://www.googleapis.com/auth/presentations.currentonly
  • https://www.googleapis.com/auth/presentations