Skip to content

DirectWrite vs GDI

Piotr Grochowski edited this page Sep 19, 2019 · 2 revisions

First of all, the most important difference. Text rendered with GDI is smooth, as the gamma is correct. Text rendered with DirectWrite is unsmooth due to incorrect gamma.

.

About GDI font rendering

For many years GDI was the only font engine in Windows. In January 2000, Microsoft extended GDI to take advantage of LCD screens. This extension was called ClearType – a form of sub-pixel positioning and anti-aliasing – to the font engine, and that gave people some limited options to tweak fonts to their liking as LCDs became more popular.

Other than the addition of ClearType, GDI remained pretty much the same throughout the years. Microsoft did release GDI+, however it wasn't well documented, so not many software developers used it.

One good feature of GDI however, is that it's fairly well documented, and through some Windows-friendly hooking of the Windows API, GDI can be replaced. This was first done by a piece of software called GDI++, and later GDIPlus, with a goal of making the FreeType-style font rendering from Linux available to Windows users.

While ClearType was a welcome improvement to Windows GDI font rendering, many discerning users considered Linux or Mac font rendering to be superior—more legible, less fatiguing, smoother, more like printed words on a page. (Other people simply don't care, and that's fine, too.)

As work on GDI++ and GDIPlus stopped, MacType took over and has since added many features. MacType is now a stable, highly-configurable option for replacing fonts in most Windows software, giving people who care about nicer fonts a better option.

For the handful of Windows apps that don't behave with MacType, it's normally because that software has poorly implemented fonts (some indie games for example), or the app itself fiddles with GDI. In these cases MacType can easily be disabled for this software.

So overall MacType is a pretty mature option to replace GDI font rendering.

About DirectWrite font rendering

DirectWrite first shipped with Windows 7 in July 2009, and was designed to replace GDI and GDI+. It does have several technical advantages over GDI including better international language support, and advanced typography support.

When DirectWrite was first released, however, many people were confused that DirectWrite fonts appeared worse than GDI/ClearType, especially because of the other major font engines (FreeType's and Apple's) that were both mature, and visually superior. In a technical sense DirectWrite was a step forward, in a visual sense it was a step back, actually losing some of the features of GDI such as sub-pixel anti-aliasing.

Microsoft themselves demonstrated a lack of confidence with the new platform by, in January 2013, releasing Office 2013, which didn't use GDI or DirectWrite (at this time DirectWrite had been available for over 5 years). Office 2013 used its own kind of font rendering which didn't followed any accepted standard.

In recent years however, since Windows 10, Microsoft has doubled down on DirectWrite, improving its rendering and adding some missing features. The Office team agrees apparently (or was forced to agree), and has also supported DirectWrite since Office 2016.

People with high DPI screens may also not see a big problem with DirectWrite, as fonts produced by it can appear smooth in many situations on a high DPI screen. However there are still situations where fonts produced by DirectWrite are inferior to FreeType or Apple fonts even with high DPI, and some people still prefer having the option to use MacType.

DirectWrite vs GDI

One interesting side-effect of DirectWrite, is – unlike GDI – it allows each app to customise how it displays its fonts. This can and does result several apps on the screen all with slightly different text appearance, and is not a good design choice from an OS design perspective. PC screens can present a lot of information at once, and extraneous visual information such as different UI elements, or different fonts, distracts from information that's actually relevant to a user.

Another way of expressing this problem is; imagine a screen with 20 random colour blocks that serve no purpose: The blocks will likely distract a user from their current task. This is why good interface design attempts to reduce unnecessary visual information and to standardise—to create a common visual language that a user can become accustomed to. It's also why several types of font rendering methods on the same screen is a bad idea. Even if it's not noticed at a conscious level, it's noticed unconsciously by the reticular activating system, which can result in mental fatigue, or other odd side-effects, especially with prolonged use.

We do hope Microsoft continues to improve the visual aspects of DirectWrite to match Apple's or FreeType's rendering and enforce standardisation across apps.

In the meantime however many users prefer to use MacType with apps that support GDI, to attain the higher quality and visually consistent FreeType rendering on Windows.

Clone this wiki locally