WPF模糊字体问题-解决方案 [英] WPF Blurry fonts issue- Solutions

查看:23
本文介绍了WPF模糊字体问题-解决方案的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

问题在以下链接中进行了描述和演示:

  • ",解释了注册表中可能的用户端调整:

    • ClearType 级别:子像素提示的数量
    • 伽玛级
    • 像素结构:显示像素中的色条如何排列
    • 文本对比度级别:调整字形词干的宽度,使字体更重

    使用这些设置并没有真正改善根本问题,但可以帮助减少敏感用户的颜色渗色效果.

    另一种方法

    Text Clarity 文章给出的最佳建议是增加字体大小和更改字体.Calibri 比标准的 Segoe UI 更适合我.由于它作为网络字体的流行,我也尝试过 Verdana,但它的重量在 14pt 和 15pt 之间有一个令人讨厌的跳跃,这在为字体大小设置动画时非常明显.

    WPF 4.0

    WPF 4 将改进对影响字体渲染的支持.有一篇关于WPF 文本博客 解释更改.最突出的是,现在(至少)三种不同的文本呈现方式:

    <grumble>这对每个设计师来说应该足够了.</grumble>

    Problem is described and demonstrated on the following links:

    Explanation: Text Clarity in WPF. This link has font comparison.

    I would like to collect all possible solutions for this problem. Microsoft Expression Blend uses WPF but fonts look readable.

    • Dark background as in Microsoft Expression Blend
    • Increasing the font size and changing the font (Calibri ... ) [link]
    • Embed windows forms [link]
    • Use GDI+ and/or Windows Forms TextRenderer class to render text to a bitmap, and then render that bitmap as a WPF control. [link]

    Are there any more solutions?

    This is going to be fixed in VS2010 (and WPF4) beta 2

    IT LOOKS LIKE IT HAS BEEN FINALLY SOLVED !

    Scott Hanselman's ComputerZen.com: WPF and Text Blurriness, now with complete Clarity

    解决方案

    Technical background

    There is a in-depth article about WPF Text rendering from one of the WPF Text Program Managers on windowsclient.net: Text Clarity in WPF.

    The problem boils down to WPF needing a linearly scaling font-renderer for smooth animations. Pure ClearType on the other hand takes quite a bit of freedom with the font to push vertical stems into the next pixel.

    The difference is obvious if one compares the classic "cascade" pattern. WinForms on the lower left side, WPF on the top right side:

    While I'm no fan of WPF's font rendering idiosyncrasies either, I can imagine the clamor if the animations would jump like they do in the Winforms cascade.

    Playing with the registry

    Of special interest to me was the link to the MSDN article "ClearType Registry Settings", which explains the possible user-side adjustments in the registry:

    • ClearType level: amount of subpixel hinting
    • Gamma level
    • Pixel structure: how the color stripes in a display-pixel are arranged
    • Text contrast level: adjusts the width of glyph stems to make the font heavier

    Playing around with these settings didn't really improve the underlying problem, but can help by reducing the color bleeding effect for sensitive users.

    Another approach

    The best advice the Text Clarity article gave was increasing the font size and changing the font. Calibri works for me better than the standard Segoe UI. Due to its popularity as web font, I tried Verdana too, but it has a nasty jump in weight between 14pt and 15pt which is very visible when animating the font size.

    WPF 4.0

    WPF 4 will have improved support for influencing the rendering of fonts. There is an article on the WPF Text Blog explaining the changes. Most prominently, there are now (at least) three different kinds of text rendering:

    <grumble>That should be enough rope for every designer.</grumble>

    这篇关于WPF模糊字体问题-解决方案的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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