raphael_turtle
raphael_turtle

Reputation: 7314

Can't get @font-face working within a rails app

Is there a default location for where I should be storing the fonts? Within rails I can't get the font to load, whereas with the 'font kit' downloaded from fontsquirrel.com where the font,css and sample html in the same folder will work.

this is my css

@font-face {
font-family: 'RalewayThin';
src: url('fonts/raleway_thin.eot');
src: url('fonts/raleway_thin.ttf') format('truetype');

}

the fonts folder is in /public

Upvotes: 1

Views: 2673

Answers (2)

Corey
Corey

Reputation: 2243

For my style sheets I almost always have to have urls start with ../ to get the correct path. You might want to try

@font-face {
  font-family: 'RalewayThin';
  src: url('../fonts/raleway_thin.eot');
  src: url('../fonts/raleway_thin.ttf') format('truetype');
}

If that doesn't work, you might want to use the developer tools in your browser to see if and what url the browse is using to get the font files.

Upvotes: 2

Kali Charan Rajput
Kali Charan Rajput

Reputation: 12646

hi your font name is different check this

font-family: 'RalewayThin'; src: local('Raleway Thin')

Upvotes: 0

Related Questions