Kindly consider the following steps:
Note:
Ensure that your font name is correctly specified throughout and double-check the availability of all font face files.
Include in Production.rb:
config.host_path = "http://---site url--"
Add the following in CSS:
@font-face {
font-family: 'Webfont';
src: url('<%= Rails.application.config.host_path %>/assets/fonts/Webfont.eot');
src: url('<%= Rails.application.config.host_path %>/assets/fonts/Webfont.eot?#iefix') format('embedded-opentype'),
url('<%= Rails.application.config.host_path %>/assets/fonts/Webfont.woff') format('woff'),
url('<%= Rails.application.config.host_path %>/assets/fonts/Webfont.ttf') format('truetype'),
url('<%= Rails.application.config.host_path %>/assets/fonts/Webfont.svg#Webfont') format('svg');
font-weight: normal;
font-style: normal;
}
If you prefer not to hard code the font file paths, simply use the following in css.
@font-face {
font-family: 'Webfont';
src: url('Webfont.eot');
src: url('Webfont.eot?#iefix') format('embedded-opentype'),
url('Webfont.woff') format('woff'),
url('Webfont.ttf') format('truetype'),
url('Webfont.svg#Webfont') format('svg');
font-weight: normal;
font-style: normal;
}
It's essential to specify the complete URL path for accessing font files.
Hopefully, this information proves helpful.