我在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属性设置为'always',并将-webkit-font-smoothing设置为antialiased,font-weight也指定为700为常规,900为粗体而不是'normal',但没有任何效果。
请建议最佳解决方案......
答案 0 :(得分:0)
所有浏览器中的Web字体都不流畅。您可能必须将-webkit-font-smoothing: antialiased
用于网络工具包浏览器。
您最好使用text-shadow: 0px 0px 1px #GOOD-COLOR-HERE
或text-shadow: 0px 0px 1px rgba(COLOR-SETTINGS-HERE)
并调整颜色设置和阴影以获得最佳效果。
答案 1 :(得分:0)
当说问题仍然存在于所有浏览器中时,会出现问题,您的字体或其他内容有问题吗? 您是否可以尝试使用Windows中的其他自定义字体来查看结果?
虽然@Madhu Rox提供的解决方案非常先进。