class OoxmlParser::FontReference

Class for parsing ‘a:fontRef` tags

Attributes

index[R]

@return [String] Font Collection Index

scheme_color[R]

@return [Color] scheme color of FontReference

Public Instance Methods

parse(node) click to toggle source

Parse FontReference object @param node [Nokogiri::XML:Element] node to parse @return [FontReference] result of parsing

# File lib/ooxml_parser/common_parser/common_data/alternate_content/drawing/graphic/shape/docx_shape/shape_style/font_reference.rb, line 14
def parse(node)
  node.attributes.each do |key, value|
    case key
    when 'idx'
      @index = value.value.to_s
    end
  end

  node.xpath('*').each do |node_child|
    case node_child.name
    when 'schemeClr'
      @scheme_color = Color.new(parent: self).parse_scheme_color(node_child)
    end
  end
  self
end