Class Autofit  |  Apps Script  |  Google for Developers (original) (raw)

Class Autofit

Stay organized with collections Save and categorize content based on your preferences.

Autofit

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

Detailed documentation

disableAutofit()

Sets the [AutofitType](/apps-script/reference/slides/autofit-type) of a shape to [AutofitType.NONE](/apps-script/reference/slides/autofit-type#NONE).

Return

[Autofit](#) — The autofit, for chaining.

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


getAutofitType()

Gets the [AutofitType](/apps-script/reference/slides/autofit-type) of the shape.

Return

[AutofitType](/apps-script/reference/slides/autofit-type) — The autofit type.

Authorization

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


getFontScale()

Gets the font scale applied to the shape. For shapes with [AutofitType](/apps-script/reference/slides/autofit-type) [AutofitType.NONE](/apps-script/reference/slides/autofit-type#NONE) or [AutofitType.SHAPE_AUTOFIT](/apps-script/reference/slides/autofit-type#SHAPE%5FAUTOFIT), this value is the default value of 1. For [AutofitType.TEXT_AUTOFIT](/apps-script/reference/slides/autofit-type#TEXT%5FAUTOFIT), 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:


getLineSpacingReduction()

Gets the line spacing reduction applied to the shape. For shapes with [AutofitType](/apps-script/reference/slides/autofit-type) [AutofitType.NONE](/apps-script/reference/slides/autofit-type#NONE) or [AutofitType.SHAPE_AUTOFIT](/apps-script/reference/slides/autofit-type#SHAPE%5FAUTOFIT), this value is the default value of 0. For [AutofitType.TEXT_AUTOFIT](/apps-script/reference/slides/autofit-type#TEXT%5FAUTOFIT), 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:

Except as otherwise noted, the content of this page is licensed under the Creative Commons Attribution 4.0 License, and code samples are licensed under the Apache 2.0 License. For details, see the Google Developers Site Policies. Java is a registered trademark of Oracle and/or its affiliates.

Last updated 2024-12-02 UTC.