Class: OoxmlParser::FontCollection

Inherits:
OOXMLDocumentObject show all
Defined in:
lib/ooxml_parser/pptx_parser/presentation/presentation_theme/font_scheme/font_collection.rb

Overview

Class for parsing ‘a:majorFont`, `a:minorFont` tag

Instance Attribute Summary collapse

Attributes inherited from OOXMLDocumentObject

#parent

Instance Method Summary collapse

Methods inherited from OOXMLDocumentObject

#==, #boolean_attribute_value, #initialize, #parse_xml, #with_data?

Methods included from OoxmlObjectAttributeHelper

#attribute_enabled?, #option_enabled?

Methods included from OoxmlDocumentObjectHelper

#to_hash

Constructor Details

This class inherits a constructor from OoxmlParser::OOXMLDocumentObject

Instance Attribute Details

#complex_scriptTextFont (readonly)

Returns complex script text font.

Returns:

  • (TextFont)

    complex script text font



12
13
14
# File 'lib/ooxml_parser/pptx_parser/presentation/presentation_theme/font_scheme/font_collection.rb', line 12

def complex_script
  @complex_script
end

#east_asianTextFont (readonly)

Returns east asian text font.

Returns:



10
11
12
# File 'lib/ooxml_parser/pptx_parser/presentation/presentation_theme/font_scheme/font_collection.rb', line 10

def east_asian
  @east_asian
end

#latinTextFont (readonly)

Returns latin text font.

Returns:



8
9
10
# File 'lib/ooxml_parser/pptx_parser/presentation/presentation_theme/font_scheme/font_collection.rb', line 8

def latin
  @latin
end

Instance Method Details

#parse(node) ⇒ FontCollection

Parse FontCollection object

Parameters:

  • node (Nokogiri::XML:Element)

    node to parse

Returns:



17
18
19
20
21
22
23
24
25
26
27
28
29
# File 'lib/ooxml_parser/pptx_parser/presentation/presentation_theme/font_scheme/font_collection.rb', line 17

def parse(node)
  node.xpath('*').each do |node_child|
    case node_child.name
    when 'latin'
      @latin = TextFont.new(parent: self).parse(node_child)
    when 'ea'
      @east_asian = TextFont.new(parent: self).parse(node_child)
    when 'cs'
      @complex_script = TextFont.new(parent: self).parse(node_child)
    end
  end
  self
end