Class: Prune::Elements::Font

Inherits:
Base
  • Object
show all
Defined in:
lib/prune/elements/font.rb

Instance Attribute Summary

Attributes inherited from Base

#document

Instance Method Summary collapse

Methods inherited from Base

#reference, #register, #to_s

Methods included from Functions

#mm_to_pt, #pt_to_mm

Methods included from PObjects

pa, pd, ph, pl, pn, ps

Constructor Details

#initialize(document, options) ⇒ Font

Initialize.



7
8
9
10
11
12
13
14
# File 'lib/prune/elements/font.rb', line 7

def initialize(document, options)
  super(document)
  # Set dictionary.
  @content = pd(pn(:Type) => pn(:Font))
  @content.update(options)
  # Register element to document.
  register
end

Instance Method Details

#base_font=(base_font) ⇒ Object

Set base font.



27
28
29
# File 'lib/prune/elements/font.rb', line 27

def base_font=(base_font)
  @content[pn(:BaseFont)] = base_font
end

#encodingObject

Get encoding of the font.



32
33
34
# File 'lib/prune/elements/font.rb', line 32

def encoding
  @content[pn(:Encoding)]
end

#nameObject

Get name of the font.



17
18
19
# File 'lib/prune/elements/font.rb', line 17

def name
  @content[pn(:Name)]
end

#name=(name) ⇒ Object

Set name of the font.



22
23
24
# File 'lib/prune/elements/font.rb', line 22

def name=(name)
  @content[pn(:Name)] = name
end