如何在IE(6/7/8)(VML)中关闭文本抗锯齿?

4

地图

http://i.stack.imgur.com/YZp6L.jpg!

我使用了 Raphael JS 来实现一个地图,该库封装了 VML 和 SVG 以支持跨浏览器绘图。

除了在 IE(6/7/8) 中的字体外,一切看起来都很好。

在 VML 中似乎开启了 AntiAliasing 渲染文本,导致文本不清晰和模糊,请问有没有办法关闭 AntiAliasing?

2个回答

0
  1. 尽量不要在font-size中使用px,而是使用pt%
  2. 您可以使用@font-faceeot字体格式。自定义字体可以无锯齿地呈现。

示例:

<html>
<head>
   <style type="text/css">
      @font-face {
         font-family:comic;
         src:url(http://valid_url/some_font_file.eot);
      }
   </style>
</head>
<body>
   <p style="font-family: comic; font-size: 18pt;">This paragraph uses the font-face 
   rule defined in the above style element. The rule embeds an OpenType file for the 
   Comic Sans font. </p>
</body>
</html>

你可以使用FontSquirrel生成器来生成EOT字体文件。

0
SVG 标签中添加 shape-rendering = 'crispEdges',这样可以解决问题吗?
您还可以尝试将 font-smooth: never 添加到 SVG 样式中。

我在SVG中没有这个问题,我在VML中有问题。 - Mr.Wang from Next Door

网页内容由stack overflow 提供, 点击上面的
可以查看英文原文,
原文链接