Class: Docxer::Word::Fonts::Font
- Inherits:
-
Object
- Object
- Docxer::Word::Fonts::Font
- Defined in:
- lib/docxer/word/fonts/font.rb
Instance Attribute Summary collapse
-
#name ⇒ Object
Returns the value of attribute name.
-
#options ⇒ Object
Returns the value of attribute options.
Instance Method Summary collapse
- #build(xml) ⇒ Object
-
#initialize(name, options) ⇒ Font
constructor
A new instance of Font.
Constructor Details
#initialize(name, options) ⇒ Font
Returns a new instance of Font.
7 8 9 10 |
# File 'lib/docxer/word/fonts/font.rb', line 7 def initialize(name, ) @name = name @options = end |
Instance Attribute Details
#name ⇒ Object
Returns the value of attribute name.
6 7 8 |
# File 'lib/docxer/word/fonts/font.rb', line 6 def name @name end |
#options ⇒ Object
Returns the value of attribute options.
6 7 8 |
# File 'lib/docxer/word/fonts/font.rb', line 6 def @options end |
Instance Method Details
#build(xml) ⇒ Object
12 13 14 15 16 17 18 19 20 |
# File 'lib/docxer/word/fonts/font.rb', line 12 def build(xml) xml['w'].font('w:name' => @name) do xml['w'].panose1('w:val' => @options[:panose] ) xml['w'].charset('w:val' => @options[:charset] ) xml['w'].family('w:val' => @options[:family] ) xml['w'].pitch('w:val' => @options[:pitch] ) xml['w'].sig( @options[:sig] ) end end |