Re: Font Quality Windows Vista64
- From: Behdad Esfahbod <behdad behdad org>
- To: Jeremy Moles <jeremy emperorlinux com>
- Cc: gtk-i18n-list gnome org
- Subject: Re: Font Quality Windows Vista64
- Date: Thu, 29 Jan 2009 13:10:55 -0500
Hi Jeremy,
Jeremy Moles wrote:
> Hello all! I'm writing a cross platform OpenGL application that uses
> Pangocairo to render fonts. In Linux, the results I get are
> superb--arguably better than anything else out in a 3D application. :) I
> couldn't happier.
>
> However, I setup my development environment for Windows last night
> (using the free MSVC2008) and used the gtk+ "bundle" linked to on the
> Pango website. In Windows, using the same code, the quality I get is
> pretty wretched--there's literally no hinting, and the glyphs sometimes
> appear to be off-by-one pixel or so.
Cairo's win32 font backend mostly ignores all font options. That may be part
of the problem. If you can reproduce the problem without OpenGL, I'm sure
people on cairo list will be interested to see it.
> What I'm looking for are some hints as to how to get the best quality
> fonts in Windows. Is there a way to force Pango to use a particular
> backend? Is there a configuration problem perhaps? Does anyone else use
> Pangocairo in Windows and get high-quality results?
If your GTK+ bundle has cairo and pango built with FreeType+fontconfig
support, you can use pango_cairo_font_map_new_for_font_type() to use the
pangocairo-fc backend instead of pangocairo-win32. If that function returns
NULL, you know the support is not compiled in and you can fall back to using
pango_cairo_font_map_get_default(). It may be worthwhile to get the default
font map first and only try the new_for_font_type() if the default font map is
not of the desired type. Something like:
fontmap = pango_cairo_font_map_get_default ()
if (pango_cairo_font_map_get_font_type (fontmap) != CAIRO_FONT_TYPE_FT)
{
ftfontmap = pango_cairo_font_map_new_for_font_type (CAIRO_FONT_TYPE_FT)
if (ftfontmap)
fontmap = ftfontmap;
else
fontmap = g_object_ref (fontmap);
}
else
fontmap = g_object_ref (fontmap);
You can als set the ftfontmap as the default pangocairo fontmap using
pango_cairo_font_map_set_default().
Regards,
behdad
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]