【问题标题】:custom font problem in opera歌剧中的自定义字体问题
【发布时间】:2011-07-13 05:37:09
【问题描述】:

我正在使用 css 字体导入属性作为自定义字体,以便在我的网站中使用。字体是“LeagueGothic.otf”和“DroidSans.ttf”。除了opera(v-11.50),所有浏览器都表现完美。字体不流畅。他们已经打破了年龄,这看起来很丑陋。 cufon 完美,但我不想使用它。有什么解决办法吗?多谢。你可以看看我的 css 代码风格 -

@font-face {
    font-family: DroidSans;
    src: url(DroidSans.ttf);
}
@font-face {
    font-family: League Gothic;
    src: url(LeagueGothic.otf);
}

body { color: #333333; font-family:'DroidSans',Arial; font-size:14px; line-height:20px;}
h1, h2, h3, h4, h5, h6, a{font-family: "League Gothic","Arial Narrow","Arial",sans-serif; font-weight: lighter; text-transform: uppercase;}

【问题讨论】:

标签: css fonts opera


【解决方案1】:

Opera 团队在 Opera 浏览器中嵌入了一个新的字体渲染模块以支持“.WOFF”格式。他们从 Opera 11.10 开始使用这个新模块。 尝试将您的字体“.ttf”和“.otf”格式转换为“.WOFF”,它应该与MicrosoftMozillaOpera兼容> 浏览器。我在此处添加了一个链接来支持我的回答。

http://dev.opera.com/articles/view/introducing-woff-web-open-font-format/#introduction

@font-face {
  font-family: 'raleway';
  src: url('raleway_thin-webfont.woff') format('woff');
  font-style: normal;
}

em {
  font-family: raleway, serif;
  color: #F45355;

}

另外,如果其他人想查看有关他们字体的 Opera 文档。 http://www.opera.com/docs/specs/presto29/css/fonts/

【讨论】:

    【解决方案2】:

    Opera 是唯一的浏览器,不支持带有 css 的自定义字体。我不知道为什么,但这很愚蠢。我不关心 Opera 客户/观众和使用文本浏览器的人一样。他们不喜欢新事物,好吧。

    如果您不想要 cufon,另一种方法是 typekit https://typekit.com/ 对于个人页面,这是免费的,但这与 cufon 类似。

    【讨论】:

    【解决方案3】:

    我解决了这个问题。我使用 fontsquirrel.com 或类似这个工具来生成 webfont,这在所有浏览器中都可以正常工作。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2013-02-26
      • 2012-04-02
      • 2018-07-12
      • 1970-01-01
      • 2012-11-29
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多