Gary Bzt
Gary Bzt

Reputation: 11

Font doesnt work on heroku

I added custom fonts in my rails app, in a folder webfonts in assets.

In my file _variables.scss (in the folder stylesheets/config), I added this code:

@import url("//hello.myfonts.net/count/2ff6c8");


@font-face {font-family: 'Variable-Regular';
  src: url('webfonts/2FF6C8_0_0.eot');
  src: url('webfonts/2FF6C8_0_0.eot?#iefix') format('embedded-opentype'),
  url('webfonts/2FF6C8_0_0.woff2') format('woff2'),
  url('webfonts/2FF6C8_0_0.woff') format('woff'),
  url('webfonts/2FF6C8_0_0.ttf') format('truetype');
} 

It works in my development environnement, but not in my production environnement. What should I do to make it work on Heroku?

Upvotes: 1

Views: 118

Answers (1)

hedgesky
hedgesky

Reputation: 3311

It depends on exact error. Maybe there are not proper headers and thus font files are not loading. You could try font_assets gem in this case.

Upvotes: 1

Related Questions