Skip to content

Instantly share code, notes, and snippets.

@chsh
Created March 5, 2012 16:52
Show Gist options
  • Save chsh/1979238 to your computer and use it in GitHub Desktop.
Save chsh/1979238 to your computer and use it in GitHub Desktop.
Iconic font helper for rails.
module IconicFontHelper
ICONIC_FONT_NAMES = {
hash: '#',
question_mark: '?',
at: '@',
pilcrow: '¶',
info: 'ℹ',
arrow_left: '←',
arrow_up: '↑',
arrow_right: '→',
arrow_down: '↓',
home: '⌂',
sun_fill: '☀',
cloud: '☁',
umbrella: '☂',
star: '★',
moon_fill: '☾',
heart_fill: '❤',
cog: '⚙',
bolt: '⚡',
key_fill: '⚿',
rain: '⛆',
denied: '⛔',
mail: '✉',
pen: '✎',
check: '✓',
check_alt: '✔',
x: '✗',
x_alt: '✘',
left_quote: '❝',
right_quote: '❞',
plus: '➕',
minus: '➖',
curved_arrow: '⤵',
document_alt_fill: '',
calendar: '',
map_pin_alt: '',
comment_alt1_fill: '',
comment_alt2_fill: '',
pen_alt_fill: '',
pen_alt2: '',
chat_alt_fill: '',
plus_alt: '',
minus_alt: '',
bars_alt: '',
book_alt: '',
aperture_alt: '',
beaker_alt: '',
left_quote_alt: '',
right_quote_alt: '',
arrow_left_alt1: '',
arrow_up_alt1: '',
arrow_right_alt1: '',
arrow_down_alt1: '',
arrow_left_alt2: '',
arrow_up_alt2: '',
arrow_right_alt2: '',
arrow_down_alt2: '',
brush: '',
brush_alt: '',
eyedropper: '',
layers: '',
layers_alt: '',
compass: '',
award_fill: '',
beaker: '',
steering_wheel: '',
eye: '',
aperture: '',
image: '',
chart: '',
chart_alt: '',
target: '',
tag_fill: '',
rss: '',
rss_alt: '',
share: '',
undo: '',
reload: '',
reload_alt: '',
loop_alt1: '',
loop_alt2: '',
loop_alt3: '',
loop_alt4: '',
spin: '',
spin_alt: '',
move_horizontal: '',
move_horizontal_alt1: '',
move_horizontal_alt2: '',
move_vertical: '',
move_vertical_alt1: '',
move_vertical_alt2: '',
move: '',
move_alt1: '',
move_alt2: '',
transfer: '',
download: '',
upload: '',
cloud_download: '',
cloud_upload: '',
fork: '',
play: '',
play_alt: '',
pause: '',
stop: '',
eject: '',
first: '',
last: '',
fullscreen: '',
fullscreen_alt: '',
fullscreen_exit: '',
fullscreen_exit_alt: '',
equalizer: '',
article: '',
read_more: '',
list: '',
list_nested: '',
cursor: '',
dial: '',
new_window: '',
trash_fill: '',
battery_half: '',
battery_empty: '',
battery_charging: '',
chat: '',
mic: '',
movie: '',
headphones: '',
user: '',
lightbulb: '',
cd: '',
folder_fill: '',
document_fill: '',
pin: '',
map_pin_fill: '',
book: '',
book_alt2: '',
box: '',
calendar_alt_fill: '',
comment_fill: '',
iphone: '',
bars: '',
camera: '',
volume_mute: '',
volume: '',
battery_full: '',
magnifying_glass: '',
lock_fill: '',
unlock_fill: '',
link: '',
wrench: '',
clock: '',
}
def m(name)
content_tag('span', class: 'iconic') do
raw ICONIC_FONT_NAMES[name]
end
end
end
@chsh
Copy link
Author

chsh commented Mar 5, 2012

Your should prepare css and webfonts described below:

@font-face {
    font-family: 'IconicStroke';
    src: url('iconic_stroke.eot');
    src: local('IconicStroke'), url('iconic_stroke.svg#iconic') format('svg'), url('iconic_stroke.otf') format('opentype');
}
.iconic {
    display:inline-block;
    font-family: 'IconicStroke';
}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment