Sha256: d1e805b15ef1778b891f85fca66f47f80db62d933b4edd76356177d302154aee

Contents?: true

Size: 671 Bytes

Versions: 13

Compression:

Stored size: 671 Bytes

Contents

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

        attr_reader :fonts, :relationships

        use_namespaces :r, :w

        def initialize
          @fonts = []
          @relationships = OpenXml::Parts::Rels.new
        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

13 entries across 13 versions & 1 rubygems

Version Path
openxml-docx-0.11.5 lib/openxml/docx/parts/fonts.rb
openxml-docx-0.11.4 lib/openxml/docx/parts/fonts.rb
openxml-docx-0.11.3 lib/openxml/docx/parts/fonts.rb
openxml-docx-0.11.2 lib/openxml/docx/parts/fonts.rb
openxml-docx-0.11.1 lib/openxml/docx/parts/fonts.rb
openxml-docx-0.11.0 lib/openxml/docx/parts/fonts.rb
openxml-docx-0.11.0.rc lib/openxml/docx/parts/fonts.rb
openxml-docx-0.10.6 lib/openxml/docx/parts/fonts.rb
openxml-docx-0.10.5 lib/openxml/docx/parts/fonts.rb
openxml-docx-0.10.4 lib/openxml/docx/parts/fonts.rb
openxml-docx-0.10.3 lib/openxml/docx/parts/fonts.rb
openxml-docx-0.10.2 lib/openxml/docx/parts/fonts.rb
openxml-docx-0.10.1 lib/openxml/docx/parts/fonts.rb