@字体面仍无法正常工作与Firefox和htaccess的无法正常、字体、工作、htaccess

2023-09-02 01:08:34 作者:陌路人

我已经搜查,搜查,搜查,但我仍然无法弄清楚如何获得在Firefox加载我的自定义字体。使用@字体面性,我有这样的头部分:

I've searched and searched and searched but I still can't figure out how to get my custom font loaded in Firefox. Using the @font-face property, I have this in the head section:

@font-face {
   font-family: 'MeanTimeMedium';
src: url('http://sweetbacklove.com/fonts/meantimec3-webfont.eot');
src: url('http://sweetbacklove.com/fonts/meantimec3-webfont.eot?#iefix') format('embedded-opentype'),
     url('http://sweetbacklove.com/fonts/MeanTimec3.ttf') format('truetype'),
     url('http://sweetbacklove.com/fonts/meantimec3-webfont.woff') format('woff'),
     url('http://sweetbacklove.com/fonts/meantimec3-webfont.svg#MeanTimeMedium') format('svg');}

由于Firefox将不接受直接链接到其他领域,我把一个.htaccess文件在我的字体文件夹中的阅读这样:

Because Firefox won't accept direct links to other domains, I put an .htaccess file in my "fonts" folder reading as such:

<FilesMatch ".(ttf|ttc|otf|eot|woff)$">
<IfModule mod_headers.c>
    Header set Access-Control-Allow-Origin "*"
</IfModule>
</FilesMatch>

不过,我收到蹲下。如果任何人都可以提供任何见解,这将是极大的AP preciated。

Still, I'm getting squat. If anyone could provide any insight, it would be greatly appreciated.

我的网站。字体和.htaccess文件是在Windows服务器IIS 7.0上托管在GoDaddy的。

My website. The fonts and .htaccess file are hosted on GoDaddy on a Windows server with IIS 7.0.

感谢。

推荐答案

谷歌的Web字体API生成/使用link标签,放置在HTML头标记。

Google Web Fonts API generates/uses link tags, to be placed in the html head tag.

<link href='http://fonts.googleapis.com/css?family=Capriola' rel='stylesheet' type='text/css'>

在本页面链接到,它处理一个GET请求到.woff文件,这是字体/ WOFF的MIME类型。

When this page is linked to, it handles a Get Request to a .woff file, which is a mime type of font/woff.

参见该计算器文章&LT; css @字体面不工作与Firefox,但与铬工作和IE >,你我要添加以下MIME类型在你的.htaccess文件。

Referring to this stackoverflow article < css @font-face not working with firefox, but working with chrome and IE >, you my want to add the following Mime Types in your .htaccess file.

AddType font/ttf .ttf
AddType font/eot .eot
AddType font/otf .otf
AddType font/woff .woff

您也可以尝试直接链接到字体文件(我没有试过)

You could also try directly linking to the font file (I haven't tried this)

<link href='http://sweetbacklove.com/fonts/meantimec3-webfont.woff' rel='stylesheet' type='font/woff' media='all'>