Class: Icomoon2Sass::Font

Inherits:
Object
  • Object
show all
Defined in:
lib/icomoon2sass/font.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(metadata) ⇒ Font

Returns a new instance of Font.



6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
# File 'lib/icomoon2sass/font.rb', line 6

def initialize()
  @icons = {}

  json = JSON.parse()

  @font_family = json['preferences']['fontPref']['metadata']['fontFamily']    

  json['icons'].each do |icon|
    @icons[icon['properties']['name']] = {
      character: [icon['properties']['code']].pack('U'),
      codepoint: '\%0x' % icon['properties']['code'].ord
    }

  end

end

Instance Attribute Details

#font_familyObject (readonly)

Returns the value of attribute font_family.



4
5
6
# File 'lib/icomoon2sass/font.rb', line 4

def font_family
  @font_family
end

#iconsObject (readonly)

Returns the value of attribute icons.



4
5
6
# File 'lib/icomoon2sass/font.rb', line 4

def icons
  @icons
end