Search code examples
cssfont-face

css @font-face in bourbon


I'm trying to add a custom font to a site, and I'm not sure where I'm going wrong.

In my SASS (bourbon) file, I have

@font-face {  
font-family: "officina";  
src: url("../fonts/officina/OfficinaSansStd-Book.otf") format("opentype");  
}

body {
   font-family: officina;
}

pretty basic. I have looked at the source for the page, and I don't see the officina font-file link anywhere. Should there be one? I'm concerned that the path may be the issue I'm having, but I'm not sure how to check this. I'm using rails, but I don't think I need to create a route to the font directly. I'm also using backbone, and I've placed the font in my assets directory, which is why it is one level up from my css.


Solution

  • Ok, I got this resolved. The problem was that ruby wanted a route. Rather than keep the font in a separate font path, I put it in the media path which already existed, but using the stylesheets path itself in theory would have worked as well.