[cairo] Pango+Cario : proper font rendering under Win32
Owen Taylor
otaylor at redhat.com
Fri Jan 6 10:19:41 PST 2006
On Thu, 2006-01-05 at 13:09 +0100, Timothée Lecomte wrote:
> Under Linux, the result is good, the fonts are properly antialiased.
> However, under MS-Windows (with binary snapshots of
> cairo1.0.2/pango1.10.1 distributed at
> ftp://ftp.gtk.org/pub/gtk/v2.8/win32/), the same code gives uglier
> results, with black text "over-antialiased" with a subpixel method.
>
> Here are screenshots :
> http://tipote.free.fr/wxt15.png (linux, various fonts, result satisfying)
> http://tipote.free.fr/wxt_windows4.png (windows, using font "Sans", size 15)
I don't see huge problems with your results, actually.
But there's a general problem that text rendering antialiasing only
works fully correctly in Windows if you draw directly to a no-alpha
target surface with a mode of OVER and a solid color. Anything else,
Pango needs to extract a mask from the windows text and draw with that,
and then the Gamma correction that Windows text gets in the way
rather than helping.
(You'll see far worse results for white-on-black generally than
for black-on-white.)
I'd try writing the simplest possible Cairo program that draws text
and see how the text there looks ... if it looks OK, you are probably
running into the above problem. If not, I don't know what is going
on.
Most of the font options aren't honored in the Windows backend, but
even if they were, the defaults should give you text that matches
the system when possible.
Regards,
Owen
More information about the cairo
mailing list