Class: Google::Apis::DocsV1::TextStyle

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

Overview

Represents the styling that can be applied to text. Inherited text styles are represented as unset fields in this message. A text style's parent depends on where the text style is defined: * The TextStyle of text in a Paragraph inherits from the paragraph's corresponding named style type. * The TextStyle on a named style inherits from the normal text named style. * The TextStyle of the normal text named style inherits from the default text style in the Docs editor. * The TextStyle on a Paragraph element that's contained in a table may inherit its text style from the table style. If the text style does not inherit from a parent, unsetting fields will revert the style to a value matching the defaults in the Docs editor.

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(**args) ⇒ TextStyle

Returns a new instance of TextStyle.



6829
6830
6831
# File 'lib/google/apis/docs_v1/classes.rb', line 6829

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

Instance Attribute Details

#background_colorGoogle::Apis::DocsV1::OptionalColor

A color that can either be fully opaque or fully transparent. Corresponds to the JSON property backgroundColor



6769
6770
6771
# File 'lib/google/apis/docs_v1/classes.rb', line 6769

def background_color
  @background_color
end

#baseline_offsetString

The text's vertical offset from its normal position. Text with SUPERSCRIPT or SUBSCRIPT baseline offsets is automatically rendered in a smaller font size, computed based on the font_size field. Changes in this field don't affect the font_size. Corresponds to the JSON property baselineOffset

Returns:

  • (String)


6777
6778
6779
# File 'lib/google/apis/docs_v1/classes.rb', line 6777

def baseline_offset
  @baseline_offset
end

#boldBoolean Also known as: bold?

Whether or not the text is rendered as bold. Corresponds to the JSON property bold

Returns:

  • (Boolean)


6782
6783
6784
# File 'lib/google/apis/docs_v1/classes.rb', line 6782

def bold
  @bold
end

#font_sizeGoogle::Apis::DocsV1::Dimension

A magnitude in a single direction in the specified units. Corresponds to the JSON property fontSize



6788
6789
6790
# File 'lib/google/apis/docs_v1/classes.rb', line 6788

def font_size
  @font_size
end

#foreground_colorGoogle::Apis::DocsV1::OptionalColor

A color that can either be fully opaque or fully transparent. Corresponds to the JSON property foregroundColor



6793
6794
6795
# File 'lib/google/apis/docs_v1/classes.rb', line 6793

def foreground_color
  @foreground_color
end

#italicBoolean Also known as: italic?

Whether or not the text is italicized. Corresponds to the JSON property italic

Returns:

  • (Boolean)


6798
6799
6800
# File 'lib/google/apis/docs_v1/classes.rb', line 6798

def italic
  @italic
end

A reference to another portion of a document or an external URL resource. Corresponds to the JSON property link



6804
6805
6806
# File 'lib/google/apis/docs_v1/classes.rb', line 6804

def link
  @link
end

#small_capsBoolean Also known as: small_caps?

Whether or not the text is in small capital letters. Corresponds to the JSON property smallCaps

Returns:

  • (Boolean)


6809
6810
6811
# File 'lib/google/apis/docs_v1/classes.rb', line 6809

def small_caps
  @small_caps
end

#strikethroughBoolean Also known as: strikethrough?

Whether or not the text is struck through. Corresponds to the JSON property strikethrough

Returns:

  • (Boolean)


6815
6816
6817
# File 'lib/google/apis/docs_v1/classes.rb', line 6815

def strikethrough
  @strikethrough
end

#underlineBoolean Also known as: underline?

Whether or not the text is underlined. Corresponds to the JSON property underline

Returns:

  • (Boolean)


6821
6822
6823
# File 'lib/google/apis/docs_v1/classes.rb', line 6821

def underline
  @underline
end

#weighted_font_familyGoogle::Apis::DocsV1::WeightedFontFamily

Represents a font family and weight of text. Corresponds to the JSON property weightedFontFamily



6827
6828
6829
# File 'lib/google/apis/docs_v1/classes.rb', line 6827

def weighted_font_family
  @weighted_font_family
end

Instance Method Details

#update!(**args) ⇒ Object

Update properties of this object



6834
6835
6836
6837
6838
6839
6840
6841
6842
6843
6844
6845
6846
# File 'lib/google/apis/docs_v1/classes.rb', line 6834

def update!(**args)
  @background_color = args[:background_color] if args.key?(:background_color)
  @baseline_offset = args[:baseline_offset] if args.key?(:baseline_offset)
  @bold = args[:bold] if args.key?(:bold)
  @font_size = args[:font_size] if args.key?(:font_size)
  @foreground_color = args[:foreground_color] if args.key?(:foreground_color)
  @italic = args[:italic] if args.key?(:italic)
  @link = args[:link] if args.key?(:link)
  @small_caps = args[:small_caps] if args.key?(:small_caps)
  @strikethrough = args[:strikethrough] if args.key?(:strikethrough)
  @underline = args[:underline] if args.key?(:underline)
  @weighted_font_family = args[:weighted_font_family] if args.key?(:weighted_font_family)
end