Class: Google::Apis::SlidesV1::Autofit

Inherits:
Object
  • Object
show all
Includes:
Core::Hashable, Core::JsonObjectSupport
Defined in:
lib/google/apis/slides_v1/classes.rb,
lib/google/apis/slides_v1/representations.rb,
lib/google/apis/slides_v1/representations.rb

Overview

The autofit properties of a Shape.

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(**args) ⇒ Autofit

Returns a new instance of Autofit.



156
157
158
# File 'lib/google/apis/slides_v1/classes.rb', line 156

def initialize(**args)
   update!(**args)
end

Instance Attribute Details

#autofit_typeString

The autofit type of the shape. If the autofit type is AUTOFIT_TYPE_UNSPECIFIED, the autofit type is inherited from a parent placeholder if it exists. The field is automatically set to NONE if a request is made that might affect text fitting within its bounding text box. In this case the font_scale is applied to the font_size and the line_spacing_reduction is applied to the line_spacing. Both properties are also reset to default values. Corresponds to the JSON property autofitType

Returns:

  • (String)


138
139
140
# File 'lib/google/apis/slides_v1/classes.rb', line 138

def autofit_type
  @autofit_type
end

#font_scaleFloat

The font scale applied to the shape. For shapes with autofit_type NONE or SHAPE_AUTOFIT, this value is the default value of 1. For TEXT_AUTOFIT, this value multiplied by the font_size gives the font size that is rendered in the editor. This property is read-only. Corresponds to the JSON property fontScale

Returns:

  • (Float)


146
147
148
# File 'lib/google/apis/slides_v1/classes.rb', line 146

def font_scale
  @font_scale
end

#line_spacing_reductionFloat

The line spacing reduction applied to the shape. For shapes with autofit_type NONE or SHAPE_AUTOFIT, this value is the default value of 0. For TEXT_AUTOFIT, this value subtracted from the line_spacing gives the line spacing that is rendered in the editor. This property is read-only. Corresponds to the JSON property lineSpacingReduction

Returns:

  • (Float)


154
155
156
# File 'lib/google/apis/slides_v1/classes.rb', line 154

def line_spacing_reduction
  @line_spacing_reduction
end

Instance Method Details

#update!(**args) ⇒ Object

Update properties of this object



161
162
163
164
165
# File 'lib/google/apis/slides_v1/classes.rb', line 161

def update!(**args)
  @autofit_type = args[:autofit_type] if args.key?(:autofit_type)
  @font_scale = args[:font_scale] if args.key?(:font_scale)
  @line_spacing_reduction = args[:line_spacing_reduction] if args.key?(:line_spacing_reduction)
end