@font-face and letter-spacing in webkit

被刻印的时光 ゝ 提交于 2019-11-28 10:38:51

I'm not sure I have the answer but I was having a word-spacing problem with League Gothic from Font Squirrel, I couldn't figure it out until I re-generated the font-face stuff on the site using different settings. I use the Paul Irish's Bulletproof method...

Font Squirrel settings http://img59.imageshack.us/img59/8784/screenshot20100428at132.png

I had the same problem, and I was able to clear it up using this code:

@font-face {
    font-family: 'League Gothic';
    src: url('/assets/fonts/league_gothic-webfont-webfont.eot');
    src: local('‚ò∫'),
            url(data:font/woff;charset=utf-8;base64,/* base64-encoded font here */) format('woff'),
            url(data:font/truetype;charset=utf-8;base64,/* base64-encoded font here */) format('truetype'),
            url('/assets/fonts/league_gothic-webfont-webfont.svg#webfontu5sqNtGI') format('svg');
    font-weight: normal;
    font-style: normal;
}

This was mostly generated from FontSquirrel and then modified slightly (I removed the local() stuff and substituted the junk characters).

This cleared up my letter-spacing issues.

It seems to me that this is caused only by svg fonts!!! I wasn't able to verify it strictly but my test cases prove that much.

Reorder your font-face urls putting svg format last, it should fix the problem. But svg fonts won't get used and rendering might be dirty(er)

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!