Organiza tus páginas con colecciones Guarda y categoriza el contenido según tus preferencias.
Autofit
Describe la configuración de ajuste automático de una forma. Si se realiza un cambio que podría afectar el ajuste del texto dentro de su cuadro de texto de límite, haz lo siguiente:
La función Autofit se desactiva y se establece en AutofitType.NONE.
La escala de la fuente se restablece al valor predeterminado y se aplica al tamaño de la fuente.
La reducción del interlineado se restablece al valor predeterminado y se aplica al interlineado.
Obtiene la escala de fuente aplicada a la forma. Para las formas con AutofitTypeAutofitType.NONE o AutofitType.SHAPE_AUTOFIT, este valor es el valor predeterminado de 1. Para AutofitType.TEXT_AUTOFIT, el valor que se muestra es por el que se multiplica el tamaño de fuente original para que se ajuste a la forma.
Volver
Number: Es la escala de la fuente.
Autorización
Las secuencias de comandos que usan este método requieren autorización con uno o más de los siguientes ámbitos:
Obtiene la reducción del interlineado aplicada a la forma. Para las formas con AutofitType, AutofitType.NONE o AutofitType.SHAPE_AUTOFIT, este valor es el valor predeterminado de 0. Para AutofitType.TEXT_AUTOFIT, el valor que se muestra es la cantidad de espacio que se resta del espacio original para que el texto se ajuste a la forma.
Volver
Number: Es el interlineado.
Autorización
Las secuencias de comandos que usan este método requieren autorización con uno o más de los siguientes ámbitos:
[[["Fácil de comprender","easyToUnderstand","thumb-up"],["Resolvió mi problema","solvedMyProblem","thumb-up"],["Otro","otherUp","thumb-up"]],[["Falta la información que necesito","missingTheInformationINeed","thumb-down"],["Muy complicado o demasiados pasos","tooComplicatedTooManySteps","thumb-down"],["Desactualizado","outOfDate","thumb-down"],["Problema de traducción","translationIssue","thumb-down"],["Problema con las muestras o los códigos","samplesCodeIssue","thumb-down"],["Otro","otherDown","thumb-down"]],["Última actualización: 2025-07-26 (UTC)"],[[["\u003cp\u003eAutofit settings determine how text adjusts within a shape's boundaries in Google Slides, and when modified, the settings reset to defaults, impacting font scale and line spacing.\u003c/p\u003e\n"],["\u003cp\u003eDevelopers can utilize methods like \u003ccode\u003edisableAutofit()\u003c/code\u003e, \u003ccode\u003egetAutofitType()\u003c/code\u003e, \u003ccode\u003egetFontScale()\u003c/code\u003e, and \u003ccode\u003egetLineSpacingReduction()\u003c/code\u003e to manage the Autofit behavior of shapes programmatically.\u003c/p\u003e\n"],["\u003cp\u003eThe \u003ccode\u003egetFontScale()\u003c/code\u003e and \u003ccode\u003egetLineSpacingReduction()\u003c/code\u003e methods return default values for shapes with AutofitType.NONE or AutofitType.SHAPE_AUTOFIT, while for AutofitType.TEXT_AUTOFIT, they reflect adjustments made to fit text within the shape.\u003c/p\u003e\n"],["\u003cp\u003eAll provided methods necessitate authorization with specific scopes like \u003ccode\u003ehttps://www.googleapis.com/auth/presentations.currentonly\u003c/code\u003e or \u003ccode\u003ehttps://www.googleapis.com/auth/presentations\u003c/code\u003e for scripts to function correctly.\u003c/p\u003e\n"]]],[],null,["Autofit\n\nDescribes the autofit settings of a shape. If a change is made that might affect text fitting\nwithin its bounding text box:\n\n- Autofit is deactivated and set to [AutofitType.NONE](/apps-script/reference/slides/autofit-type#NONE).\n- The font scale is reset to the default value and applied to the font size.\n- The line spacing reduction is reset to the default value and applied to the line spacing. \n\nMethods\n\n| Method | Return type | Brief description |\n|---------------------------------------------------------|-----------------------------------------------------------|-------------------------------------------------------------------------------------------------------------------------------------------------------|\n| [disableAutofit()](#disableAutofit()) | [Autofit](#) | Sets the [AutofitType](/apps-script/reference/slides/autofit-type) of a shape to [AutofitType.NONE](/apps-script/reference/slides/autofit-type#NONE). |\n| [getAutofitType()](#getAutofitType()) | [AutofitType](/apps-script/reference/slides/autofit-type) | Gets the [AutofitType](/apps-script/reference/slides/autofit-type) of the shape. |\n| [getFontScale()](#getFontScale()) | `Number` | Gets the font scale applied to the shape. |\n| [getLineSpacingReduction()](#getLineSpacingReduction()) | `Number` | Gets the line spacing reduction applied to the shape. |\n\nDetailed documentation \n\n`disable``Autofit()` \nSets the [AutofitType](/apps-script/reference/slides/autofit-type) of a shape to [AutofitType.NONE](/apps-script/reference/slides/autofit-type#NONE).\n\nReturn\n\n\n[Autofit](#) --- The autofit, for chaining.\n\nAuthorization\n\nScripts that use this method require authorization with one or more of the following [scopes](/apps-script/concepts/scopes#setting_explicit_scopes):\n\n- `https://www.googleapis.com/auth/presentations.currentonly`\n- `https://www.googleapis.com/auth/presentations`\n\n*** ** * ** ***\n\n`get``Autofit``Type()` \nGets the [AutofitType](/apps-script/reference/slides/autofit-type) of the shape.\n\nReturn\n\n\n[AutofitType](/apps-script/reference/slides/autofit-type) --- The autofit type.\n\nAuthorization\n\nScripts that use this method require authorization with one or more of the following [scopes](/apps-script/concepts/scopes#setting_explicit_scopes):\n\n- `https://www.googleapis.com/auth/presentations.currentonly`\n- `https://www.googleapis.com/auth/presentations`\n\n*** ** * ** ***\n\n`get``Font``Scale()` \nGets 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_AUTOFIT), this value is the default value of 1.\nFor [AutofitType.TEXT_AUTOFIT](/apps-script/reference/slides/autofit-type#TEXT_AUTOFIT), the value returned is what the original font size is\nmultiplied by to fit within the shape.\n\nReturn\n\n\n`Number` --- The font scale.\n\nAuthorization\n\nScripts that use this method require authorization with one or more of the following [scopes](/apps-script/concepts/scopes#setting_explicit_scopes):\n\n- `https://www.googleapis.com/auth/presentations.currentonly`\n- `https://www.googleapis.com/auth/presentations`\n\n*** ** * ** ***\n\n`get``Line``Spacing``Reduction()` \nGets the line spacing reduction applied to the shape. For shapes with [AutofitType](/apps-script/reference/slides/autofit-type)\n[AutofitType.NONE](/apps-script/reference/slides/autofit-type#NONE) or [AutofitType.SHAPE_AUTOFIT](/apps-script/reference/slides/autofit-type#SHAPE_AUTOFIT), this value is the default value\nof 0. For [AutofitType.TEXT_AUTOFIT](/apps-script/reference/slides/autofit-type#TEXT_AUTOFIT), the returned value is the amount of spacing\nsubtracted from the original spacing to make the text fit within the shape.\n\nReturn\n\n\n`Number` --- The line spacing.\n\nAuthorization\n\nScripts that use this method require authorization with one or more of the following [scopes](/apps-script/concepts/scopes#setting_explicit_scopes):\n\n- `https://www.googleapis.com/auth/presentations.currentonly`\n- `https://www.googleapis.com/auth/presentations`"]]