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

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

问题描述

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


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


    • ClearType等级:亚像素提示量

    • 伽马等级
    • 像素结构:如何排列显示像素中的彩条

    • 文字对比度:调整字形的宽度以使字体更重


    使用这些设置并不能真正改善底层问题,但可以帮助降低敏感用户的色彩流失效果。 b

    另一种方法



    Text Clarity文章给出的最好建议是增加字体大小和更改字体。 Calibri比标准的Segoe UI更适合我。由于网络字体的普及,我也尝试了Verdana,但是在14pt和15pt之间有一个令人讨厌的跳跃,这在动画字体大小的时候非常明显。 b
    $ b

    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

    WPF 4.0 Text Stack Improvements

    IT LOOKS LIKE IT HAS BEEN FINALLY SOLVED !

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

    解决方案

    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天全站免登陆