Archivio mensile:gennaio 2016

How to use fonts on Rails assets pipeline

@font-face {
    font-family:'/assets/HDVPeace';
    src: font-url('/assets/HDV_Peace.eot');
    src: font-url('/assets/HDV_Peace.eot?iefix') format('eot'),
        font-url('/assets/HDV_Peace.woff') format('woff'),
        font-url('/assets/HDV_Peace.ttf') format('truetype'),
        font-url('/assets/HDV_Peace.svg#webfont') format('svg');}

in my config/application.rb I have:

config.assets.paths <<Rails.root.join('app','assets','fonts')
config.assets.precompile +=%w(.svg .eot .woff .ttf)

folder structure

app
 |----assets
        |----fonts
               |----HDV_Peace.eot
               |----HDV_Peace.svg
               |----HDV_Peace.ttf
               |----HDV_Peace.woff

Thanks to: http://stackoverflow.com/questions/18294150/how-to-use-fonts-in-rails-4