I have read several posts which seem to touch on different aspects of adding custom fonts to a rails app, but am struggling to put it all together.
I have .otf font files and need these fonts to be incorporated into my CSS.
It appears you need to add something along the lines of below in the CSS file?
I got this example from How to add a custom font to Rails app?
Any ideas what I am missing?
I have a file in my app / assets folder called MavenProLigh-200.otf
application.css.erb file
@font-face {
font-family: 'maven';
src:url('MavenProLight-300.otf');
font-weight: normal;
font-style: normal;
}
development.rb file
config.assets.enabled = true
config.assets.paths << Rails.root.join("app", "assets", "fonts")
CSS
#body{
color:#4e4f4f;
font-family:'maven';
}
This code works