Class: InvoicePrinter::Fonts

Inherits:
Object
  • Object
show all
Defined in:
lib/invoice_printer/fonts.rb

Constant Summary collapse

ASSETS_PATH =
File.expand_path('../../../assets', __FILE__)

Class Method Summary collapse

Class Method Details

.opensansObject



12
13
14
15
16
17
18
19
# File 'lib/invoice_printer/fonts.rb', line 12

def self.opensans
  {
    :normal      => "#{ASSETS_PATH}/fonts/opensans/OpenSans-Regular.ttf",
    :italic      => "#{ASSETS_PATH}/fonts/opensans/OpenSans-Regular.ttf",
    :bold        => "#{ASSETS_PATH}/fonts/opensans/OpenSans-Regular.ttf",
    :bold_italic => "#{ASSETS_PATH}/fonts/opensans/OpenSans-Regular.ttf"
  }
end

.overpassObject



21
22
23
24
25
26
27
28
# File 'lib/invoice_printer/fonts.rb', line 21

def self.overpass
  {
    :normal      => "#{ASSETS_PATH}/fonts/overpass/Overpass-Regular.ttf",
    :italic      => "#{ASSETS_PATH}/fonts/overpass/Overpass-Regular.ttf",
    :bold        => "#{ASSETS_PATH}/fonts/overpass/Overpass-Regular.ttf",
    :bold_italic => "#{ASSETS_PATH}/fonts/overpass/Overpass-Regular.ttf"
  }
end

.paths_for(font_name) ⇒ Object



6
7
8
9
10
# File 'lib/invoice_printer/fonts.rb', line 6

def self.paths_for(font_name)
  send(font_name)
rescue NoMethodError
  raise "Not supported font #{font_name}"
end

.robotoObject



30
31
32
33
34
35
36
37
# File 'lib/invoice_printer/fonts.rb', line 30

def self.roboto
  {
    :normal      => "#{ASSETS_PATH}/fonts/roboto/Roboto-Regular.ttf",
    :italic      => "#{ASSETS_PATH}/fonts/roboto/Roboto-Regular.ttf",
    :bold        => "#{ASSETS_PATH}/fonts/roboto/Roboto-Regular.ttf",
    :bold_italic => "#{ASSETS_PATH}/fonts/roboto/Roboto-Regular.ttf"
  }
end