rharriso / bower-rails

Bundler-like DSL + rake tasks for Bower on Rails
MIT License
1.46k stars 128 forks source link

Packages with fonts do not compile #182

Open chrisvel opened 8 years ago

chrisvel commented 8 years ago

I am using font-awesome and bootstrap packages on my project and working fine locally on a development environment. When I deploy to production (cloud66) the icons (fonts actually I believe) do not appear on the page, but instead of it they appear as "squares with letters" inside. What do I miss ?

chrisvel commented 8 years ago

One thing that works is setting up in application.css.scss :

@font-face {
  font-family: 'FontAwesome';
  src: font-url('font-awesome/fonts/fontawesome-webfont.eot?v=4.0.3');
  src: font-url('font-awesome/fonts/fontawesome-webfont.eot?#iefix&v=4.0.3') format('embedded-opentype'),
       font-url('font-awesome/fonts/fontawesome-webfont.woff?v=4.0.3') format('woff'),
       font-url('font-awesome/fonts/fontawesome-webfont.ttf?v=4.0.3') format('truetype'),
       font-url('font-awesome/fonts/fontawesome-webfont.svg?v=4.0.3#fontawesomeregular') format('svg');
  font-weight: normal;
  font-style: normal;
}

@font-face {
  font-family: 'Glyphicons Halflings';
  src: font-url('bootstrap/fonts/glyphicons-halflings-regular.eot');
  src: font-url('bootstrap/fonts/glyphicons-halflings-regular.eot?#iefix') format('embedded-opentype'),
       font-url('bootstrap/fonts/glyphicons-halflings-regular.woff') format('woff'),
       font-url('bootstrap/fonts/glyphicons-halflings-regular.ttf') format('truetype'),
       font-url('bootstrap/fonts/glyphicons-halflings-regular.svg#glyphicons_halflingsregular') format('svg');
}

but I don't understand why do I have to do so or why doesn't it work automatically, as in development environment everything is picked up and served by the web server.

SergeyKishenin commented 8 years ago

This is a known issue with fonts compiling https://github.com/rharriso/bower-rails/search?q=font&type=Issues&utf8=%E2%9C%93

ericenns commented 8 years ago

I am having the same problem and tried what @chrisvel described but that isn't working for me.

ericenns commented 8 years ago

I ended up getting it working, I just had to add the fonts to be precompiled assets which I was missing.