Sha256: a8624a054cc64103551892dc97d3f5e4b24f7fd72dcc96ae225f11683431a90a

Contents?: true

Size: 1 KB

Versions: 3

Compression:

Stored size: 1 KB

Contents

module OpenXml
  module Docx
    module Properties
      class Font < ComplexProperty
        tag :rFonts

        attribute :ascii, expects: :string
        attribute :ascii_theme, expects: :valid_theme
        attribute :complex, expects: :string, displays_as: :cs
        attribute :complex_theme, expects: :valid_theme, displays_as: :cstheme
        attribute :east_asia, expects: :string
        attribute :east_asia_theme, expects: :valid_theme
        attribute :high_ansi, expects: :string, displays_as: :hAnsi
        attribute :high_ansi_theme, expects: :valid_theme, displays_as: :hAnsiTheme
        attribute :hint, expects: :valid_hint

        VALID_HINTS = %i(cs default eastAsia)

        VALID_THEMES = %i(majorAscii majorBidi majorEastAsia majorHAnsi minorAscii minorBidi minorEastAsia minorHAnsi)

      private

        def valid_theme(value)
          valid_in? value, VALID_THEMES
        end

        def valid_hint(value)
          valid_in? value, VALID_HINTS
        end

      end
    end
  end
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
openxml-docx-0.9.0 lib/openxml/docx/properties/font.rb
openxml-docx-0.8.0 lib/openxml/docx/properties/font.rb
openxml-docx-0.8.0.beta1 lib/openxml/docx/properties/font.rb