Firefox 无法正确渲染单倍间距字体
好吧,这是我的问题,我认为使用 Google Webfonts 会为我解决所有跨浏览器的混乱问题,你猜怎么着,我错了。
事实证明,Firefox 不喜欢 Droid Sans Mono。特别是,它呈现的粗体字形比非粗体字形更宽,当您在 JS 中创建基于终端的黑客游戏时,这非常不方便。
你可以在这里看一下,等待几秒钟引导序列通过,然后查看顶部的状态行:
http://dl.dropbox.com/u/2332843/os/os。 html
好吧,所以现在我正在寻找一种让 Firefox 正确渲染整个内容的方法,或者是 Droid Sans Mono 的一个很好的替代方案。
OK, here's my problem I thought that using Google Webfonts would take care of all the cross Browser mess for me, well guess what, I was wrong.
It turns out that Firefox does not like Droid Sans Mono. In particular, it renders bold glyphs WIDER than the non bold ones, which turns out to be very unhandy when you're creating a terminal based hacking game in JS.
You can take a look at it here, wait a few seconds for the boot sequence to pass by, then look at the status line at the top:
http://dl.dropbox.com/u/2332843/os/os.html
Well, so now I'm in search of either a way to make Firefox render the whole thing correctly, or a good alternative to Droid Sans Mono.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
理想情况下,您需要一种具有自己的粗体变体的字体。粗体面孔通常由用户代理为缺乏实际粗体面孔的面孔合成。请参阅:
http://www.w3 .org/TR/css3-fonts/#font-weight-the-font-weight-property
一种这样的等宽字体是 DejaVu Sans Mono。该字体具有正常、粗体和斜体变体,它们以相同的宽度呈现字符。字体大小为 10 像素时清晰易读。
替代文本 http://img245.imageshack.us/img245/8166/dejavub.png< /a>
Ideally, you need a font which has its own bold variant. Bold faces are often synthesized by user agents for faces that lack actual bold faces. See:
http://www.w3.org/TR/css3-fonts/#font-weight-the-font-weight-property
One such monospaced font is DejaVu Sans Mono. This font has normal, bold and italic variants which render characters at the same width. It is legible at a font size of 10px.
alt text http://img245.imageshack.us/img245/8166/dejavub.png