Class: FontAwesome::Font

Inherits:
Object
  • Object
show all
Includes:
Singleton
Defined in:
lib/font_awesome/font.rb

Constant Summary collapse

ASCENT =
1569
DESCENT =
-430

Instance Method Summary collapse

Instance Method Details

#ascentObject



10
11
12
# File 'lib/font_awesome/font.rb', line 10

def ascent
  ASCENT
end

#character_outline(hex_code) ⇒ Object



26
27
28
# File 'lib/font_awesome/font.rb', line 26

def character_outline(hex_code)
  attribute("d", glyph(hex_code))
end

#character_width(hex_code) ⇒ Object



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

def character_width(hex_code)
  (attribute("horiz-adv-x", glyph(hex_code)) || attribute("horiz-adv-x", "font")).to_i
end

#descentObject



14
15
16
# File 'lib/font_awesome/font.rb', line 14

def descent
  DESCENT
end

#em_sizeObject



18
19
20
# File 'lib/font_awesome/font.rb', line 18

def em_size
  attribute("units-per-em", "font-face").to_i
end