IE6中以不同大小呈现的Unicode字符 [英] Unicode character rendered at a different size in IE6

查看:77
本文介绍了IE6中以不同大小呈现的Unicode字符的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在Web应用程序中,我必须显示一个特殊的Unicode字符,称为BLACK DIAMOND (U+25C6)(请参阅

In a web application, I have to display a special unicode character, know as BLACK DIAMOND (U+25C6) (see here for more details). Here is a sample :

页面定义的字体为Arial,大小为13px.

The font defined for the page is Arial, with size 13px.

令人惊讶的是,与其他浏览器(FF,Chrome等)相比,该字符在IE6中以更大的尺寸呈现.

Surprisingly, the character is rendered with a bigger size in IE6 vs other browsers (FF, Chrome, ...).

是否有这种奇怪行为的原因,如何避免这种情况?

推荐答案

这是因为您指定的字体中缺少指定的字符.因此,浏览器会寻找一种适合该字符的字体,以便它仍然可以显示它.不同的浏览器选择不同的字体,因此每种字体的浏览方式都会有所不同.

This is because the specified character is missing from the font you specified. So the browser looks for a suitable font to use for that character so it can still display it. Different browsers pick different fonts, so you'll see it a little bit differently on each.

一般而言,您可以采取很多措施来避免这种情况,因为在网络上缺少字体很常见,因此您不能真正依靠任何字体出现在用户的计算机上.不过,您可以尝试缓解这种情况:

There isn't much in general you can do to avoid this because missing fonts are very common on the web and thus you cannot really rely on any font to be present on the user's machine. You can try mitigating it, though:

  1. 您可以将U + 25C6放在一个跨度中,该跨度的样式设置为使用具有该字符的另一种特定字体(该字体可以与您的主字体很好地配合使用).
  2. 与上述相同,但是分发网络字体( WOFF 如今似乎是一个合理的选择)(包含字形).这样,您就可以更好地控制显示内容.
  3. 远离指定Arial Unicode MS之类的后备字体.只是根本不使用它们.
  4. 如果您只是追求U + 25C6的外观,并且不介意以文本形式实际使用它,则可以使用图像或
  1. You can put the U+25C6 in a span that's styled to use a different but specific font that has the character (and which works well with your main font).
  2. Same as above, but distribute a web font (WOFF seems to be a reasonable choice nowadays) that contains the glyph. That way you have more control about what is displayed.
  3. Stay far, far away from specifying fallback fonts like Arial Unicode MS. Just don't use them at all.
  4. If you're just after the looks of U+25C6 and don't care about having it actually in text form you can use an image or a CSS hack.

这篇关于IE6中以不同大小呈现的Unicode字符的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆