- html - 出于某种原因,IE8 对我的 Sass 文件中继承的 html5 CSS 不友好?
- JMeter 在响应断言中使用 span 标签的问题
- html - 在 :hover and :active? 上具有不同效果的 CSS 动画
- html - 相对于居中的 html 内容固定的 CSS 重复背景?
在网上搜索时,我发现了很多有关字体正确 MIME 类型的不同建议,但我还没有尝试过任何可以消除 Chrome 警告的 MIME 类型,如下所示:
Resource interpreted as font but transferred with MIME type font/otf
该字体是 OTF。
到目前为止我已经尝试过以下 MIME 类型
最佳答案
在 Apache 和 IIS 服务器上,可以为多种字体格式设置 MIME 类型。 I've traditionally had luck具有以下内容:
svg as "image/svg+xml" (W3C: August 2011)
ttf as "application/x-font-ttf" (IANA: March 2013)
or "application/x-font-truetype"
otf as "application/x-font-opentype" (IANA: March 2013)
woff as "application/font-woff" (IANA: January 2013)
woff2 as "application/font-woff2" (W3C W./E.Draft: May 2014/March 2016)
eot as "application/vnd.ms-fontobject" (IANA: December 2005)
sfnt as "application/font-sfnt" (IANA: March 2013)
根据维护有关多用途互联网邮件扩展(MIME 类型)初始文档的互联网工程任务组的说法:https://www.rfc-editor.org/rfc/rfc2045#section-5 ...它具体说:
"It is expected that additions to the larger set ofsupported types can generally be accomplished by the creation of newsubtypes of these initial types. In the future, more top-level typesmay be defined only by a standards-track extension to this standard.If another top-level type is to be used for any reason, it must begiven a name starting with "X-" to indicate its non-standard statusand to avoid a potential conflict with a future official name."
事实上,随着时间的推移,随着标准的创建和接受,其他 MIME 类型也会被添加,因此我们看到了供应商特定 MIME 类型的示例,例如 vnd.ms-fontobject 等。
2013 年 8 月 16 日更新:WOFF 为 formally registered at IANA on January 3, 2013和 Webkit has been updated on March 5, 2013在最新版本中获取此更新的浏览器将开始使用旧的 x-font-woff 声明发出有关服务器 MIME 类型的警告。由于警告只是烦人,我建议立即切换到批准的 MIME 类型。在理想的情况下,警告会及时解决。
2015 年 2 月 26 日更新:WOFF2 现已包含在 W3C 编辑草案中,并包含提议的 mime 类型。它可能会按照最近的进展时间表在明年(可能是 2016 年底)提交给 IANA。以及 SFNT,Google Web Fonts with their sfntly java library 的主干表引用中使用的可缩放/样条容器字体格式。已经是 registered as a mime type with IANA并可以根据个人需要添加到此列表中。
2017 年 10 月 4 日更新:我们可以跟踪 WOFF2 格式的进展 here大多数现代浏览器都成功支持该格式。同样,我们可以遵循 IETF 的“字体”顶级媒体类型征求意见 (RFC) tracker和 document关于供批准的最新提议字体类型集。
<小时/>对于那些希望在 CSS 中以正确顺序嵌入字体的人,请访问 this article 。但同样,我很幸运地执行了以下命令:
@font-face {
font-family: 'my-web-font';
src: url('webfont.eot');
src: url('webfont.eot?#iefix') format('embedded-opentype'),
url('webfont.woff2') format('woff2'),
url('webfont.woff') format('woff'),
url('webfont.ttf') format('truetype'),
url('webfont.svg#webfont') format('svg');
font-weight: normal;
font-style: normal;
}
<小时/>
对于 Subversion 自动属性,这些属性可以列出为:
# Font formats
svg = svn:mime-type=image/svg+xml
ttf = svn:mime-type=application/x-font-ttf
otf = svn:mime-type=application/x-font-opentype
woff = svn:mime-type=application/font-woff
woff2 = svn:mime-type=application/font-woff2
eot = svn:mime-type=application/vnd.ms-fontobject
sfnt = svn:mime-type=application/font-sfnt
关于fonts - OTF 字体的正确 MIME 类型,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/2871655/
因此,在我的字体.otf文件中,显然有两种类型的字母“a”,并且默认情况下使用错误的一种。 我想知道如何在Android / Kotlin的.otf文件中使用第二种类型的“a”。 最佳答案 根据您的评
如何生成自定义.otf字体子集文件? 用例: 存在仪表.otf字体文件。 存在特定的 Unicode 字形集(范围、点)。 输出是新的.otf文件,足以从第2点开始设置。 如何在 .NET 或 Jav
我正在尝试制作一个带有 github 页面的网站,我想包含一个 otf 字体。我无法让它正常工作,我也不确定哪里出错了。 我做了一些研究,发现我需要使用@font-face,但我无法弄清楚它应该如何工
这是我的声明代码: @font-face { font-family: 'MyOwnFont'; font-style: normal; font-weight: 400;
我们有一个带有 otf 字体文件的网站。 一切正常,除了网站在 IE 11 中的外观。 经过调查我们找到了原因: CSS3114: @font-face failed OpenType embeddi
有没有人知道字体阅读器类,我可以在其中传递字体文件(ttf 或 otf),然后我可以找出字体名称、型号、艺术家等。元数据确实如此。 感谢大家的帮助 最佳答案 这可能对您有所帮助 -ycTIN - 从
我试图在css中包含字体但没有成功。在控制台中我收到错误 在控制台中。但是当我包含另一种带有 .ttf 扩展名的字体时,它的工作原理。有什么建议吗? @font-face { font-fam
在网上搜索时,我发现了很多有关字体正确 MIME 类型的不同建议,但我还没有尝试过任何可以消除 Chrome 警告的 MIME 类型,如下所示: Resource interpreted as fon
我正在使用 otf 和 ttf 格式的自定义字体。我不知道如何找到字体的版本。 有什么方法可以在 Mac 上找到 oft 和 ttf 字体的版本吗? 最佳答案 在Linux上我们可以使用fc-quer
我正在使用 otf 和 ttf 格式的自定义字体。我不知道如何找到字体的版本。 有什么方法可以在 Mac 上找到 oft 和 ttf 字体的版本吗? 最佳答案 在Linux上我们可以使用fc-quer
Opentype font format的最新版本(截至 2016 年底为 1.8)标准化两个不同的表以嵌入 PNG 位图数据:Google 的 CBDT (与 CBLC 一起)和 Apple 的 s
我想在 WordPress 仪表板中上传自定义字体。当我尝试上传字体文件时,它显示错误: Sorry, this file type is not permitted for security rea
我有以下 HTML + CSS 源代码。我希望它使用高级 otf 功能,但样式集功能不起作用。 body { font-family: source sans pro; font-size:12px
@font-face { font-family: 'Placeholder-Font'; src: url('assets/fonts/Placeholder-Font.otf') form
我想知道是否可以在 Web 服务器上使用 otf 字体?我问这个问题是因为以下字体在本地主机上运行良好,但在 IIS 上上传时却不行。 @font-face { font-family:"Cu
我是否可以从 ttf/otf 字体文件中提取本地化名称? 首选 Python 解决方案,但我可以使用任何语言。 非常感谢。 最佳答案 转到此页面 http://wotsit.org/list.asp?
伙计们,我在从 otf 文件导入字体时遇到了问题 main.css @font-face { font-family: 'testfont'; src: url('fonts/te
我想知道是否可以“编码”TTF/OTF/SVG 字体?以某种方式写下每个字母的所有坐标。 如果是这样,我在哪里可以了解更多信息? 最佳答案 这当然是可能的。 SVG和 SVG Fonts都是 XML
我使用 laravel 框架。但是在 chrome 控制台中发生了这个错误并且 font-family 不工作。 Failed to load resource: the server respond
看起来有一些在 iPhone 上使用自定义 True Type 字体 (ttf) 的可行解决方案,最值得注意的是 Can I embed a custom font in an iPhone appl
我是一名优秀的程序员,十分优秀!