Class Autofit

Autofit

Describes the autofit settings of a shape. If a change is made that might affect text fitting within its bounding text box:

  • Autofit is deactivated and set to AutofitType.NONE.
  • The font scale is reset to the default value and applied to the font size.
  • The line spacing reduction is reset to the default value and applied to the line spacing.

Methods

MethodReturn typeBrief description
disableAutofit()AutofitSets the AutofitType of a shape to AutofitType.NONE.
getAutofitType()AutofitTypeGets the AutofitType of the shape.
getFontScale()NumberGets the font scale applied to the shape.
getLineSpacingReduction()NumberGets the line spacing reduction applied to the shape.

Detailed documentation

disableAutofit()

Sets the AutofitType of a shape to AutofitType.NONE.

Return

Autofit — The autofit, for chaining.

Authorization

Scripts that use this method require authorization with one or more of the following scopes:

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

getAutofitType()

Gets the AutofitType of the shape.

Return

AutofitType — The autofit type.

Authorization

Scripts that use this method require authorization with one or more of the following scopes:

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

getFontScale()

Gets the font scale applied to the shape. For shapes with AutofitType AutofitType.NONE or AutofitType.SHAPE_AUTOFIT, this value is the default value of 1. For AutofitType.TEXT_AUTOFIT, the value returned is what the original font size is multiplied by to fit within the shape.

Return

Number — The font scale.

Authorization

Scripts that use this method require authorization with one or more of the following scopes:

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

getLineSpacingReduction()

Gets the line spacing reduction applied to the shape. For shapes with AutofitType AutofitType.NONE or AutofitType.SHAPE_AUTOFIT, this value is the default value of 0. For AutofitType.TEXT_AUTOFIT, the returned value is the amount of spacing subtracted from the original spacing to make the text fit within the shape.

Return

Number — The line spacing.

Authorization

Scripts that use this method require authorization with one or more of the following scopes:

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