Closed house9 closed 8 years ago
I can't even begin to answer this or propose a solution. If the fonts are in the folder, obviously it wouldn't 404. But why it is not putting them in the folder through the gem, that's way out of my depth. I am open to any suggestions you have on how I could fix it though.
I looked into this some more. Turns out I was including 'all' of the source files which was adding the @font-face
declaration multiple times, some of which still had the relative path and others with the correct asset pipeline path. i.e.
@font-face {
font-family: 'weathericons';
src: url(/assets/weather-icons/font/weathericons-regular-webfont.eot);
...
AND
@font-face {
font-family: 'weathericons';
src: url(../font/weathericons-regular-webfont.eot);
...
Changing the asset pipeline require statement
require weather-icons
require weather-icons/css/weather-icons
fixed the issue. No need to manually add fonts to the public directory.
Closing this issue.
This is more of a question than an issue.
I just installed weather-icons into my Rails application as a 'rails-assets' gem (which leverages the bower.json file)
Added the necessary require statement to my css manifest file and everything works great, except there are multiple 404 requests being made before it finally finds the font file.
See attached screenshots
As a work around I copied the font files to public/font
This got rid of the 404s (and loads the fonts much faster), just wondering if there is a better way to handle this?
Thanks!