Re: Font Quality Windows Vista64



Behdad, as usual, I <3 you! (this is cubicool from IRC)

On Thu, 2009-01-29 at 13:10 -0500, Behdad Esfahbod wrote:
> 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.

I think I can; I dump the textures to disk (using the cairo write PNG
routine) and the font problems show up there, too. I was certain to rule
out my own placement or projection first before suspecting Pangocairo.

> > 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().

Fortunately, I understand every bit of what you're saying, and am
anxious to get home and try this out. :) I'll let you know what
happens...

> Regards,
> 
> behdad
> 



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]