Class: Elegant::Typography
- Inherits:
-
Object
- Object
- Elegant::Typography
- Includes:
- Prawn::View
- Defined in:
- lib/elegant/typography.rb
Instance Method Summary collapse
-
#initialize(document, options = {}) ⇒ Typography
constructor
A new instance of Typography.
-
#set_fonts ⇒ Object
Set the fonts for the document.
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, = {}) @document = document end |
Instance Method Details
#set_fonts ⇒ Object
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 |