Skip to content

Instantly share code, notes, and snippets.

@matiasinsaurralde
Created August 20, 2013 19:45
Show Gist options
  • Save matiasinsaurralde/6286254 to your computer and use it in GitHub Desktop.
Save matiasinsaurralde/6286254 to your computer and use it in GitHub Desktop.
@font-face generator
Dir[ File.join( ARGV[0], '*' ) ].each do |font|
puts "@font-face { font-family: #{font.split('/').last.split('.').first}; src: url('#{font}'); }"
end
# $ ruby font-face-generator.rb fonts/
# @font-face { font-family: Example; src: url('fonts/Example.otf'); }
# @font-face { font-family: AnotherOne; src: url('fonts/AnotherOne.otf'); }
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment