webkit 中的 @font-face 和 letter-spacing
我刚刚发现嵌入字体时,字母间距在 webkit(也许还有其他浏览器?)中并不总是有效。我尝试了两种不同的字体并收到了不同的结果。
“League Gothic Regular”将起作用
http://www.theleagueofmoveabletype.com/fonts/7 -league-gothic
“Quicksand Light”不会
http://www.fontsquirrel.com/ fonts/Quicksand
瘦的是什么?有没有办法强制使用不兼容的字体?
快速说明:Firefox 似乎确实适用于这两种字体。
I just discovered that letter-spacing doesn't always work in webkit (and perhaps other browsers?) when embedding fonts. I've tried it on two different fonts and received different results.
"League Gothic Regular" will work
http://www.theleagueofmoveabletype.com/fonts/7-league-gothic
"Quicksand Light" will not
http://www.fontsquirrel.com/fonts/Quicksand
What's the skinny? Is there a way to force the hand of non-compliant fonts?
Quick note: Firefox does seem to apply to both fonts.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
我不确定我有答案,但我在使用 Font Squirrel 的 League Gothic 时遇到了字间距问题,直到我使用不同的设置在网站上重新生成字体内容后我才弄清楚。我使用 Paul Irish 的 Bulletproof 方法...
Font Squirrel 设置 http://img59.imageshack .us/img59/8784/screenshot20100428at132.png
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
我遇到了同样的问题,我可以使用以下代码清除它:
这主要是从 FontSquirrel< 生成的/a> 然后稍微修改(我删除了 local() 内容并替换了垃圾字符)。
这解决了我的字母间距问题。
I had the same problem, and I was able to clear it up using this code:
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.
在我看来,这只是由 svg 字体引起的!!!
我无法严格验证它,但我的测试用例证明了这一点。
重新排序你的字体 URL,将 svg 格式放在最后,它应该可以解决问题。但是 svg 字体不会被使用并且渲染可能会很脏(呃)
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)