The way I did this is to put all the fonts in lib/assets/fonts .
Add these lines to config/application.rb
config.assets.paths << Rails.root.join('lib', 'assets', 'fonts') config.assets.precompile += %w(.svg .eot .woff .ttf)
Then I include fonts in the stylesheets in lib/assets/stylehseets/fonts.css , for each font something like:
@font-face { font-family: 'AvenirLTStd-Black'; src: font-url('avenirltstdblack.eot'); src: font-url('avenirltstdblack.eot?#iefix') format('embedded-opentype'), font-url('avenirltstdblack.woff') format('woff'), font-url('avenirltstdblack.ttf') format('truetype'), font-url('avenirltstdblack.svg#avenirltstdblack') format('svg'); font-weight: normal; font-style: normal; }
And include this file in app/assets/stylesheets/application.css
*= require fonts
In your css (scss) application, you can use:
font-family: 'AvenirLTStd-Black';
Then just recompile $ rake assets:precompile and redistribute. Let me know if this works for you, might have missed the step like I did this a few months ago!
source share