Class: OoxmlParser::FontCollection
- Inherits:
-
OOXMLDocumentObject
- Object
- OOXMLDocumentObject
- OoxmlParser::FontCollection
- 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
-
#complex_script ⇒ TextFont
readonly
Complex script text font.
-
#east_asian ⇒ TextFont
readonly
East asian text font.
-
#latin ⇒ TextFont
readonly
Latin text font.
Attributes inherited from OOXMLDocumentObject
Instance Method Summary collapse
-
#parse(node) ⇒ FontCollection
Parse FontCollection object.
Methods inherited from OOXMLDocumentObject
#==, #boolean_attribute_value, #initialize, #parse_xml, #with_data?
Methods included from OoxmlObjectAttributeHelper
#attribute_enabled?, #option_enabled?
Methods included from OoxmlDocumentObjectHelper
Constructor Details
This class inherits a constructor from OoxmlParser::OOXMLDocumentObject
Instance Attribute Details
#complex_script ⇒ TextFont (readonly)
Returns 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_asian ⇒ TextFont (readonly)
Returns east asian text font.
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 |
#latin ⇒ TextFont (readonly)
Returns latin text font.
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
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 |