css - 使用 font-face() 时 compass 错误 "Could not determine font type"

标签 css fonts compass-sass

我正在尝试使用 Compass's font-face function 导入字体.我给出以下指令:

@include font-face("Avenir", font-files("Avenir.ttc"));

并得到以下错误:

error assets/styles/sass/styles.scss (Line 1 of assets/styles/sass/_typography.scss: Could not determine font type for "Avenir.ttc")

我没有指定 fonts_dir在我的 config.rb 文件中,但我的字体文件放在 <css_styles>/fonts 中目录,根据上面链接的文档,这是默认位置。

有人知道这里可能出了什么问题吗?

最佳答案

Compass 无法识别 ttc 扩展名,您应该使用 CSS 3 字体规范中定义的扩展名之一:http://www.w3.org/TR/css3-fonts/#src-desc

关于css - 使用 font-face() 时 compass 错误 "Could not determine font type",我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/22082222/

相关文章:

html - 如何设置具有相同 ID 和不同操作属性或 url 的 2 个 <form> 标签的样式?

jquery - Js Animate 在 IE8 下无法正常工作

java - 如何使用 Java 从字体文件中读取 Unicode 范围

css - Grunt watch 抛出 NoMethodError

css - 将鼠标悬停在字体 awesome : how to change the size or edges of the icons? 的图标上

Javascript:如何显示带有 <div> 内容的弹出窗口

html - 如果不支持字体,请减小字体大小

java - 打开 html 代码时,自定义 StructuredTextEditor 不显示颜色代码。

css - ie8 忽略了我所有的字体声明

ant - 在 ant 中将 Sass 和 Compass 作为 jar 运行时找不到文件错误