相关疑难解决方法(0)

Rails 4.0中的@ font-face,找不到自定义字体的Sass URL

在我的Rails项目中,我尝试使用自定义字体.有很多与这个问题相关的答案,就像这个没有帮助的答案,我编辑development.rb:

# Add the fonts path
config.assets.paths << Rails.root.join('app', 'assets', 'fonts')

# Precompile additional assets
config.assets.precompile += %w( .svg .eot .woff .ttf )
Run Code Online (Sandbox Code Playgroud)

它仍然显示 No route matches [GET] "/assets/chalkduster-webfont.woff"

我设置我url:

@font-face {
   font-family: 'chalkdusterregular';
    src: url('chalkduster-webfont.eot');
    src:url('chalkduster-webfont.svg#chalkdusterregular') format('svg'), 
    url('chalkduster-webfont.eot?#iefix') format('embedded-opentype'),
         url('chalkduster-webfont.woff') format('woff'),
         url('chalkduster-webfont.ttf') format('truetype');
    font-weight: normal;
    font-style: normal;

}
Run Code Online (Sandbox Code Playgroud)

font_path('')在源代码中尝试过,font-url()但它也无法运行.:(

fonts ruby-on-rails font-face ruby-on-rails-4

15
推荐指数
1
解决办法
2万
查看次数

标签 统计

font-face ×1

fonts ×1

ruby-on-rails ×1

ruby-on-rails-4 ×1