【发布时间】:2014-01-22 10:56:41
【问题描述】:
我正在尝试在 Rails 中包含我的自定义字体。
我的文件字体在app/assets/fonts/。
我编辑了 CSS:
# in app/assets/stylesheets/application.css
@font-face {
font-family: 'fontello';
src: url('fonts/fontello.eot');
src: url('fonts/fontello.eot#iefix')format('embedded-opentype'),
url('fonts/fontello.woff') format('woff'),
url('fonts/fontello.ttf') format('truetype');
}
我也尝试更改路径url('assets/fonts/fontello.eot');url('fontello.eot');。
我编辑了配置:
# in config/application.rb
require File.expand_path('../boot', __FILE__)
require 'rails/all'
Bundler.require(:default, Rails.env)
module Gui
class Application < Rails::Application
config.assets.paths << Rails.root.join('app', 'assets', 'fonts')
end
end
但它不起作用。
我使用的是 Rails 4.0.2。
【问题讨论】:
标签: css ruby-on-rails ruby fonts