Failed to decode the downloaded font glyphicons-halflings-regular.woff2 - Rails, Production

Im uses bootstrap3-wysihtml5 and some of the icons use glyphicons font.

I'm having problems using glyphicon halflings - the regular font in my rails application when it works during production. My Chrome browser console shows

Failed to decode the downloaded font 

and font icons are not displayed. I see a square around where the icons should be displayed. Fonts seem to work locally, even if they are precompiled locally and run as local production. Im managing assets are precompiled in production.

My fonts were originally located in the vendor directory under the plugins and added the config.assets.paths path.

I am sure the paths are correct in the CSS file, because I can successfully access the file through the browser url. And the fact that the console warning shows “Failed to decode the downloaded font” means that it has access to it. I just can not understand the file.

I also tried registering Mimetypes in the rails mimetype configuration:

 Mime::Type.register 'application/x-font-woff', :woff Mime::Type.register 'application/font-woff2', :woff2 Mime::Type.register 'application/x-font-ttf', :ttf Mime::Type.register 'application/vnd.ms-fontobject', :eot 

I also tried moving fonts from the asset pipeline by placing them in a shared folder and referencing accordingly, but I get the same problem.

Does anyone have any ideas on how I can solve this?

Usage: Rails 4.1.6 Ruby 2.2.2

+6
source share
1 answer

I have already met this experience. This was resolved by downloading the latest bootstrap 3 font version and replacing them.

0
source

All Articles