我已经看到几个问题提出了类似的问题,但是我无法使用未安装该字体的计算机在我的生产应用程序中渲染该字体。
http://fortawesome.github.com/Font-Awesome/
安装了这个:https ://github.com/bokmann/font-awesome-rails
添加了这个:
*= require 'font-awesome'
到 application.css
图标正在工作,例如:
<i class="icon-envelope"></i>
正确呈现实际上是字体真棒字体之一的信封图标。但是,我无法在生产中显示字母字体(我只看到 Times New Roman)。我试过这些说明无济于事:
http://blog.fieldforceapp.com/moving-to-heroku-bootstrap-font-awesome
我担心我的样式表目录(在 app/assets/stylesheets 中)可能与其他 css 冲突:
/*
* This is a manifest file that'll be compiled into application.css, which will include all the files
* listed below.
*
* Any CSS and SCSS file within this directory, lib/assets/stylesheets, vendor/assets/stylesheets,
* or vendor/assets/stylesheets of plugins, if any, can be referenced here using a relative path.
*
* You're free to add application-wide styles to this file and they'll appear at the top of the
* compiled file, but it's generally better to create a new file per style scope.
*
*= require select2
*= require bootstrap-timepicker
*= require 'font-awesome'
*= require_tree .
*= require zpp.css
*/
我需要一个单独的字体目录吗?我正在运行 rake assets:precompile 并看到字体 .css 文件移动到我的公共目录中,但仍然不行。
希望得到一些关于这个 b/c 的帮助,我已经挠头太久了。谢谢!