css - 字体在 Windows 中看起来失真

标签 css html twitter-bootstrap font-face

我正在用 ubuntu 做一个网站,并完成了 UI 部分。在 ubuntu 中一切都运行顺利,但是当我打开 Windows 时,所有字体都失真了。我尝试了以下代码

@font-face {
    font-family: 'garrisonsb';
    src: url('../fonts/garrisons-bold.eot');
    src: url('../fonts/garrisons-bold.eot?#iefix') format('embedded-opentype'),
         url('../fonts/garrisons-bold.woff') format('woff'),
         url('../fonts/garrisons-bold.ttf') format('truetype'),
         url('../fonts/garrisons-bold.svg#garrison_sansbold') format('svg');
    font-weight: bold;
    font-style: normal;

}

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

}

@font-face {
    font-family: 'rupee';
    src: url('../fonts/Rupee.eot');
    src: url('../fonts/Rupee.eot?#iefix') format('embedded-opentype'),
         url('../fonts/Rupee.woff') format('woff'),
         url('../fonts/Rupee.ttf') format('truetype'),
         url('../fonts/Rupee.svg#rupeeregular') format('svg');
    font-weight: normal;
    font-style: normal;

}

指定的代码是使用 squirrel-generator 生成的。我尝试将 font-smooth 属性设置为“始终”,并将 -webkit-font-smoothing 设置为抗锯齿,字体粗细也指定为 700(常规)和 900(粗体)而不是“正常”,但没有任何效果。

请提出最佳解决方案......

最佳答案

Web 字体在所有浏览器中都不是流畅的。对于 web-kit 浏览器,您可能必须使用 -webkit-font-smoothing: antialiased

你最好使用 text-shadow: 0px 0px 1px #GOOD-COLOR-HEREtext-shadow: 0px 0px 1px rgba(COLOR-SETTINGS-HERE) 和调整颜色设置和阴影以获得最佳效果。

关于css - 字体在 Windows 中看起来失真,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/15251399/

相关文章:

javascript - 如何在根页面上突出显示索引导航链接

javascript - 如何更改 chardin.js 中的文本颜色和样式

html - 带有显示 :inline-block but position is wrong 的 CSS ul li

javascript - bootstrap 切换点击并显示数据 3 次时出错

jquery - 我有一个 Wordpress 驱动的网站,我的联系表单 7 插件在表单底部添加了大量空格,我不确定为什么

css - 设备 div 屏幕重叠,我该如何解决?

html - 在第二个 div 上给出边框底部

javascript - jQuery animate - 不透明度比高度慢

javascript - 如何使用 Twitter Bootstrap(带有面板、 Accordion 等)创建嵌套可折叠容器的所需布局?

css - 我需要使用媒体查询设置 anchor 标记中心