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:
- Autofit is deactivated and set to
[AutofitType.NONE](/apps-script/reference/slides/autofit-type#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.
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:
https://www.googleapis.com/auth/presentations.currentonly
https://www.googleapis.com/auth/presentations
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:
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](/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:
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](/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:
https://www.googleapis.com/auth/presentations.currentonly
https://www.googleapis.com/auth/presentations
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.