我在Mac上编码了一个网站,然后使用了自定义字体。我使用以下字体规则定义了自定义字体:

@font-face
{
font-family: gnuolane;
src: url('../fonts/gnuolane.otf'),
}


问题在于该字体未在任何浏览器的任何Windows版本上加载。在我的Mac上,在Safari / Chrome / FF上运行完美。

This is the website.

这是当font-face正常工作时的样子:



谢谢

LE:
我从fontsquirrel.com生成了此代码和所有这些文件。还是行不通。我尝试使用'../ fonts / gnuolane ....'和'/ fonts / gnuolane ....'

@font-face {
font-family: 'gnuolane';
src: url('../fonts/gnuolane_rg-webfont.eot');
src: url('../fonts/gnuolane_rg-webfont.eot?#iefix') format('embedded-opentype'),
     url('../fonts/gnuolane_rg-webfont.woff') format('woff'),
     url('../fonts/gnuolane_rg-webfont.ttf') format('truetype'),
     url('../fonts/gnuolane_rg-webfont.svg#gnuolane_rgregular') format('svg');
font-weight: normal;
font-style: normal;
}


仍然无法正常工作。

最佳答案

将所有字体文件(我指的是实际字体)移到与CSS文件相同的文件夹中...
然后使用此CSS块。告诉我是否可行。我觉得这是一个路径问题...

@font-face {
    font-family: 'gnuolane';
    src: url('gnuolane_rg-webfont.eot');
    src: url('gnuolane_rg-webfont.eot?#iefix') format('embedded-opentype'),
    url('gnuolane_rg-webfont.woff') format('woff'),
    url('gnuolane_rg-webfont.ttf') format('truetype'),
    url('gnuolane_rg-webfont.svg#gnuolane_rgregular') format('svg');
    font-weight: normal;
    font-style: normal;
}

09-17 11:40
查看更多