I'm having trouble including fonts for my rails app. I tried following the advice from this post: Using fonts with Rails asset pipeline, but I'm still confused.
I'm trying to add this font. I made an app/assets/fonts
folder and added the fonts to it. I changed production.rb
accordingly.
I'm confused about declaring my fonts like so:
@font-face {
font-family: 'Icomoon';
src:url('icomoon.eot');
src:url('icomoon.eot?#iefix') format('embedded-opentype'),
url('icomoon.svg#icomoon') format('svg'),
url('icomoon.woff') format('woff'),
url('icomoon.ttf') format('truetype');
font-weight: normal;
font-style: normal;
}
These are my 4 RobotoSlab fonts:
RobotoSlab-Bold.ttf
RobotoSlab-Light.ttf
RobotoSlab-Regular.ttf
RobotoSlab-Thin.ttf
They all have dashes in the names. So what do I write instead of iconmoon.eot
? RobotoSlab-Regular.ttf
or RobotoSlab.ttf
?
Also, I'm confused about where I should address the .eot
part, and where I should address the .ttf
part. In the example above, the .eot
part was addressed first, and then the .ttf
part was addressed along with all the other formats. But the default extension for my font is .ttf
, so does that change things?
Also, I'm confused about which font files I'm supposed to include. Most fonts on http://www.fontsquirrel.com/ have multiple font files to download (in order to address variations of bold and italics). Are you supposed to link to all of them in @font-face
?
Thanks for the help.