【问题标题】:Why isn't my TypeKit font showing?为什么我的 TypeKit 字体不显示?
【发布时间】:2014-02-21 18:53:16
【问题描述】:

我在 TypeKit 中使用的字体称为“museo”。它似乎没有加载或显示在我的实时网站上。

我已将这两行添加到我的 application.html.erb

  <script type="text/javascript" src="//use.typekit.net/ayn8han.js"></script>
    <script type="text/javascript">try{Typekit.load();}catch(e){}</script>

还有我的 CSS:

@font-face {
  font-family: "museo",'ProximaNovaRegular',serif;
  src: url("<%= font_path('proximanova-regular-webfont.eot') %>");
  src: url("<%= font_path('proximanova-regular-webfont.eot') %>") format('embedded-opentype'),
  url("<%= font_path('proximanova-regular-webfont.woff') %>") format('woff'),
  url("<%= font_path('proximanova-regular-webfont.ttf') %>") format('truetype'),
  url("<%= font_path('proximanova-regular-webfont.svg#ProximaNovaRegular') %>") format('svg');
}

@font-face {
  font-family: "museo",'ProximaNovaBold', serif;
  src: url('<%= font_path('proximanova-bold-webfont.eot') %>');
  src: url('<%= font_path('proximanova-bold-webfont.eo') %>t') format('embedded-opentype'),
  url('<%= font_path('proximanova-bold-webfont.woff') %>') format('woff'),
  url('<%= font_path('proximanova-bold-webfont.ttf') %>') format('truetype'),
  url('<%= font_path('proximanova-bold-webfont.svg#ProximaNovaBold') %>') format('svg');
}

我在这里做错了什么?

【问题讨论】:

    标签: css ruby-on-rails fonts ruby-on-rails-4 typekit


    【解决方案1】:

    我知道这可能是最基本的答案,但您是否检查过“工具包设置”并确保您的域拼写正确?

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2014-07-02
      • 1970-01-01
      • 2013-08-22
      • 2021-12-16
      • 1970-01-01
      相关资源
      最近更新 更多