Class Autofit

自动调整

描述了形状的自动调整设置。如果所做的更改可能会影响文本在其边界文本框内的适应方式,则:

  • 自动调整功能会被停用,并设置为 AutofitType.NONE
  • 字体缩放比例会重置为默认值,并应用于字体大小。
  • 行距缩减量会重置为默认值,并应用于行距。

方法

方法返回值类型简介
disableAutofit()Autofit将形状的 AutofitType 设置为 AutofitType.NONE
getAutofitType()AutofitType获取形状的 AutofitType
getFontScale()Number获取应用于形状的字体缩放比例。
getLineSpacingReduction()Number获取应用于形状的行距缩减量。

详细文档

disableAutofit()

将形状的 AutofitType 设置为 AutofitType.NONE

返回

Autofit - 自动调整,用于链式调用。

授权

使用此方法的脚本需要获得以下一个或多个范围的授权:

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

getAutofitType()

获取形状的 AutofitType

返回

AutofitType - 自动调整类型。

授权

使用此方法的脚本需要获得以下一个或多个范围的授权:

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

getFontScale()

获取应用于形状的字体缩放比例。对于 AutofitType AutofitType.NONEAutofitType.SHAPE_AUTOFIT 的形状,此值为默认值 1。 对于 AutofitType.TEXT_AUTOFIT,返回的值是原始字体大小乘以该值后可适应形状。

返回

Number - 字体缩放比例。

授权

使用此方法的脚本需要获得以下一个或多个范围的授权:

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

getLineSpacingReduction()

获取应用于形状的行距缩减量。对于 AutofitType AutofitType.NONEAutofitType.SHAPE_AUTOFIT 的形状,此值为默认值 0。对于 AutofitType.TEXT_AUTOFIT,返回的值是从原始间距中减去的间距量,以使文本适应形状。

返回

Number - 行距。

授权

使用此方法的脚本需要获得以下一个或多个范围的授权:

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