css - Webfont 以不同方式加载跨浏览器(mac firefox 问题)

标签 css fonts cross-browser rendering webfonts

我使用此代码为博客使用谷歌“Comfortaa”字体

<link href='http://fonts.googleapis.com/css?family=Comfortaa&subset=greek,latin' rel='stylesheet' type='text/css'>

但是,该字体(连同其他字体)在 mac Firefox 上显示得更粗(在 Chrome mac/win firefox win 等上显示良好)

为了确定,我将所有 em 都更改为 px,而且我可以使用代码尝试使用 font squirrel

/* Generated by Font Squirrel (http://www.fontsquirrel.com) on November 2, 2012 */



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

}




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

}




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

}

问题仍然存在。(我不太确定将@font face 放在哪里 - 我通过 blogger css 应用了它)

我是不是做错了什么,或者这显然是一个无法修复的浏览器渲染问题?

最佳答案

尝试使用数字字体粗细值。在 Google webfont listening 中,您可以看到每种样式的正确字体粗细。就 Comfortaa 而言,它们是:{font-weight: 300;} 用于书籍,{font-weight: 400;} 用于普通,{font-weight: 700;} 用于粗体。

关于css - Webfont 以不同方式加载跨浏览器(mac firefox 问题),我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/13201780/

相关文章:

javascript - 打开页面加载javascript的线索提示

html - 向 css 添加边距会导致一些不需要的行为

pdf - BIRT PDF 渲染 : fonts register time

javascript - 获取参数以更改我的 .php 外部 javascript 文件以加载不同的内容

CSS 悬停过渡跨浏览器兼容性

IE 与 FF 中的 HTML DIV 和 IMG 标签间距

javascript - 我可以使用此代码显示两个不同的窗口吗?

html - 使某些元素可能消失的菜单居中

fonts - 将不寻常的字体放入网页

java - Apache FOP : failed to load and use custom font