Sha256: f3b3df06ce42deea462409e561e1e3644e3f49a5a35a3570f9651bfb1c9f92ab

Contents?: true

Size: 603 Bytes

Versions: 1

Compression:

Stored size: 603 Bytes

Contents

module OpenXml
  module Docx
    module Parts
      class Fonts < OpenXml::Part
        include RootNamespaces

        attr_reader :fonts

        use_namespaces :r, :w

        def initialize
          @fonts = []
        end

        def <<(font)
          @fonts << font
        end

        def count
          fonts.count
        end

        def to_xml
          build_standalone_xml do |xml|
            xml.fonts(root_namespaces) {
              xml.parent.namespace = :w
              fonts.each { |font| font.to_xml(xml) }
            }
          end
        end

      end
    end
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
openxml-docx-0.10.0 lib/openxml/docx/parts/fonts.rb