为什么DirectX/DirectWrite/Direct2D文本渲染不能像GDI一样清晰? [英] Why can't DirectX/DirectWrite/Direct2D text rendering be as sharp as GDI?

查看:343
本文介绍了为什么DirectX/DirectWrite/Direct2D文本渲染不能像GDI一样清晰?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我已经知道亚像素定位会导致与GDI相比,DirectWrite文本呈现较模糊.

I already know that sub-pixel positioning causes DirectWrite text rendering to be blurry compared to GDI.

但是,我的问题稍微更基本了: 为什么不能使用DirectWrite(及相关方法)来像GDI一样清晰地呈现文本?

However, my question is a bit more fundamental: Why can't DirectWrite (and related methods) be made to render text as sharply as GDI?

换句话说:
是什么阻止 DirectWrite能够像GDI一样将文本捕捉到最近的像素?

In other words:
What prevents DirectWrite from being able to snap text to the nearest pixel, the way GDI can?

例如,这是硬件问题吗?驱动程序体系结构问题?难道它根本没有实现?还是其他?

Is it, for example, a hardware issue? A driver architecture issue? Is it simply not implemented? Or something else?

Direct2D,别名:

Direct2D, aliased:

Direct2D,默认设置:

Direct2D, default:

Direct2D(经典GDI"):

Direct2D ("classic GDI"):

Direct2D(自然GDI"):

Direct2D ("natural GDI"):

实际经典GDI:

实际 ClearType GDI:

Actual ClearType GDI:

推荐答案

您没有将like与like进行比较.您的Direct2D样本全部以灰度显示,而GDI和Linux样本正在使用亚像素抗锯齿(在Windows上也称为ClearType).

You aren't comparing like with like. Your Direct2D samples are all rendered in grayscale, whereas the GDI and Linux samples are using sub-pixel anti-aliasing (aka ClearType on Windows).

此页面描述了启用清除类型所需的操作:

This page describes what you need to do to enable cleartype: http://msdn.microsoft.com/en-us/library/windows/desktop/dd368170%28v=vs.85%29.aspx

当测试这样的渲染时,总是值得使用Windows Magnifier或类似工具来检查您是否确实得到了自己认为得到的东西.

N.B. When testing rendering like this, it's always worth using Windows Magnifier or similar to check that you are actually getting what you think you are getting.

这篇关于为什么DirectX/DirectWrite/Direct2D文本渲染不能像GDI一样清晰?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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