Better Postscript CFF font rendering with DirectWrite
October 22nd, 2009 by jdaggettFor 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:
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:
The same text drawn with 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.



October 22nd, 2009 at 5:57 pm
[...] http://blog.mozilla.com/nattokirai/2009/10/22/better-postscript-cff-font-rendering-with-directwrite... a few seconds ago from web [...]
October 22nd, 2009 at 7:20 pm
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)
October 23rd, 2009 at 1:40 am
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” ).
October 23rd, 2009 at 4:56 am
As a side note, DirectWrite (along with the rest of the new Direct* APIs) will be made available to Vista users too.
October 23rd, 2009 at 6:13 pm
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.
October 25th, 2009 at 5:25 am
[...] Better Postscript CFF font rendering with DirectWrite. [...]
November 5th, 2009 at 7:05 pm
@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?
November 14th, 2009 at 2:22 am
[...] 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 [...]
November 20th, 2009 at 10:01 pm
Yeeeeaaah!
Was waiting for this.