Sha256: 19929d411ca023346494db5e1350a091d225fc291caf82bf2654af4baee585e5

Contents?: true

Size: 753 Bytes

Versions: 8

Compression:

Stored size: 753 Bytes

Contents

# frozen_string_literal: true

# Class for parsing text outline and its properties
module OoxmlParser
  # Class for parsing `w:textOutline`
  class TextOutline < OOXMLDocumentObject
    attr_accessor :width, :color_scheme

    def initialize(parent: nil)
      @width = OoxmlSize.new(0)
      @color_scheme = :none
      @parent = parent
    end

    # Parse TextOutline object
    # @param node [Nokogiri::XML:Element] node to parse
    # @return [TextOutline] result of parsing
    def parse(node)
      node.attributes.each do |key, value|
        case key
        when 'w'
          @width = OoxmlSize.new(value.value.to_f, :emu)
        end
      end
      @color_scheme = DocxColorScheme.new(parent: self).parse(node)
      self
    end
  end
end

Version data entries

8 entries across 8 versions & 1 rubygems

Version Path
ooxml_parser-0.8.1 lib/ooxml_parser/docx_parser/docx_data/document_structure/docx_paragraph/docx_paragraph_run/text_outline.rb
ooxml_parser-0.8.0 lib/ooxml_parser/docx_parser/docx_data/document_structure/docx_paragraph/docx_paragraph_run/text_outline.rb
ooxml_parser-0.7.2 lib/ooxml_parser/docx_parser/docx_data/document_structure/docx_paragraph/docx_paragraph_run/text_outline.rb
ooxml_parser-0.7.1 lib/ooxml_parser/docx_parser/docx_data/document_structure/docx_paragraph/docx_paragraph_run/text_outline.rb
ooxml_parser-0.7.0 lib/ooxml_parser/docx_parser/docx_data/document_structure/docx_paragraph/docx_paragraph_run/text_outline.rb
ooxml_parser-0.6.0 lib/ooxml_parser/docx_parser/docx_data/document_structure/docx_paragraph/docx_paragraph_run/text_outline.rb
ooxml_parser-0.5.1 lib/ooxml_parser/docx_parser/docx_data/document_structure/docx_paragraph/docx_paragraph_run/text_outline.rb
ooxml_parser-0.5.0 lib/ooxml_parser/docx_parser/docx_data/document_structure/docx_paragraph/docx_paragraph_run/text_outline.rb