I'm trying to integrate a designer's html and css files into a rails app. He's got about four @font-face files that are currently linked to in the application.css file. I've stored the fonts in an assets/fonts folder and added that folder to the asset pipeline (in config/application.rb)
I've only ever used Google fonts, where I included the a link to google in the application.html.erb file.
How should I include these font files? Should they (1) stay in the application.css file or (2) be linked to in the application.html.erb file just like javascript and styesheets? For example, something like this:
<%= asset_path('my_webfont.eot') %>
Start by putting your fonts into app/assets/fonts
. After that, you can include your fonts in a sass / scss file via the font_url('font.eot')
helper.
Otherwise, asset_path
should still find the fonts there if you're determined to use it.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With