Better Postscript CFF font rendering with DirectWrite

October 22nd, 2009 by jdaggett

For those playing with Windows 7, check out some of the work Bas Schouten has been doing with adding DirectWrite support to Firefox. DirectWrite is Microsoft’s replacement for Uniscribe in Windows 7 and it has much better rendering of Postscript CFF fonts, fonts that are typically labeled “OpenType” with an .otf extension. Many well-known font vendors ship these fonts almost exclusively.

Here’s a waterfall test that uses Jos Buivenga’s Calluna font, a beautiful serif text font that can be used as a downloadable font. In the lower part of the page is the same waterfall with Constantia, one of Microsoft’s ClearType fonts that ships with Vista and Windows 7. Below is a comparison of the default rendering now under XP and Windows 7 and the rendering with the patch Bas is working on:

Text Waterfall comparing GDI to DirectWrite rendering

At very low sizes (e.g. 6px – 9px), the text drawn with the DirectWrite API is much more readable. The reason for this is clearer if you zoom in closely and look at the pixels.

Small text (6px – 8px) drawn with Windows 7 GDI ClearType rendering:

Small text drawn with Windows 7 GDI ClearType

The same text drawn with DirectWrite:

Small text drawn with Windows 7 DirectWrite

Up close neither looks great but slide your chair back a few feet; the text rendered with GDI looks awful and is barely readable, the text rendered with DirectWrite legible. The default GDI rendering doesn’t do subpixel antialiasing so the glyphs appear less defined, they look thinner.

Great stuff!! Hats off to Bas!

Note: platform API’s on Mac OS X and Linux already do a good job rendering Postscript CFF fonts, this just brings them up to parity under Windows 7.

9 Responses to “Better Postscript CFF font rendering with DirectWrite”

  1. Alexander Limi (limi) 's status on Thursday, 22-Oct-09 08:57:43 UTC - Identi.ca Says:

    [...] http://blog.mozilla.com/nattokirai/2009/10/22/better-postscript-cff-font-rendering-with-directwrite... a few seconds ago from web [...]

  2. Olly Hodgson Says:

    This is fantastic news! I was ranting just yesterday about Firefox’s rendering of CFF fonts under Windows, so it’s great to see something being done about it :)

    Now for the big challenge. Is there anything that can be done to enable sub-pixel rendering of CFF fonts under XP and Vista? (see bug #503150)

  3. Seamus Says:

    For anyone looking at the waterfall and not seeing the type get smaller than 10px, you need to change the “Minimum font size” to “none” in the preferences ( “Preferences” > “Content” tab > “Advanced…” for “Fonts & Colors” ).

  4. Siddharth Agarwal Says:

    As a side note, DirectWrite (along with the rest of the new Direct* APIs) will be made available to Vista users too.

  5. Alex Says:

    Great to see support for DirectWrite this close to the release, sub-pixel positioning and rendering is great (for TrueType and PostScript fonts), and it removes the jitter in animation (translation and rotation and such)

    @Olly, short of ignoring GDI and using Freetype, nothing can be done, XP is too old to be getting updates like DirectWrite.

  6. Sex, lies, & type | i love typography, the typography and fonts blog Says:

    [...] Better Postscript CFF font rendering with DirectWrite. [...]

  7. Olly Hodgson Says:

    @Alex – Even if this won’t help XP users, it’s good to know Vista and W7 users will finally get better typography :)

    Any idea if this will make it into 3.6?

  8. Sex, lies, & type | i love typography, the typography and fonts blog Says:

    [...] support for WOFF. Boing Boing Redesign Uncovers Web Font IgnoranceWhere to get Web fontsBetter Postscript CFF font rendering with DirectWrite.Typotheque has now released its Web fonts. Comes with a 30-day free evaluation, so why not give it a [...]

  9. miha Says:

    Yeeeeaaah!

    Was waiting for this.

Leave a Reply