0
已下载以下字体https://www.fontsquirrel.com/fonts/montserrat并将其解压缩。卡住app/assets/fonts中的otf文件。Rails - 未能将自定义字体添加到我的应用程序
我有一个叫我的样式表文件夹base.scss
文件,其中我有这样的代码:
@font-face {
font-family: "test";
src: url("/assets/test.otf");
font-weight: normal;
font-style: normal;
}
.test {
font-size: 40px;
font-family: "test";
}
在我config/application.rb
文件更改为这个:
module Workspace
class Application < Rails::Application
# Do not swallow errors in after_commit/after_rollback callbacks.
config.active_record.raise_in_transactional_callbacks = true
# Enable the asset pipeline
config.assets.enabled = true
config.assets.paths << Rails.root.join('/app/assets/fonts')
end
end
然而自定义字体仍是不在与.test
类的文本中显示。我究竟做错了什么?顺便说一下,我正在使用云9 IDE。