Class: Elegant::Typography

Inherits:
Object
  • Object
show all
Includes:
Prawn::View
Defined in:
lib/elegant/typography.rb

Instance Method Summary collapse

Constructor Details

#initialize(document, options = {}) ⇒ Typography

Returns a new instance of Typography.



5
6
7
# File 'lib/elegant/typography.rb', line 5

def initialize(document, options = {})
  @document = document
end

Instance Method Details

#set_fontsObject

Set the fonts for the document. Fonts are provided via configuration and a ‘Fallback’ font must be set to be used for special characters. A ‘Sans Serif’ font is also required for titles and headers.



12
13
14
15
# File 'lib/elegant/typography.rb', line 12

def set_fonts
  font_families.update Elegant.configuration.fonts
  fallback_fonts ['Fallback']
end