[cairo] Win32 fonts

Jerry jerry at chordia.co.uk
Thu Sep 14 12:53:38 PDT 2006


I'm experimenting with Cairo using VS.NET on Windows XP. Using the 'text 
align center' snippet works pretty much as expected but the font quality 
seems poor in comparison to the rendering of the circle. Having had a quick 
look through the code GetGlyphOutlineW is never called with the GGO_NATIVE 
flag set in _cairo_win32_scaled_font_init_glyph_path(). Can anyone tell me 
the right way to get fonts drawn using paths rather than bitmaps ? The 
project is set up to compile for Win32 surfaces and Win32 fonts.

I tried this, which appeared to succeed but fails to actually display 
anything:

 CFontEx fontex;    // C++ Win32 font wrapper
 fontex.Create(hDC,"Tahoma",10);
 pf = cairo_win32_font_face_create_for_hfont(fontex);
 ASSERT(pf);
 cairo_set_font_face(cr,pf);
 cs = cairo_status(cr);
 ASSERT(cs == CAIRO_STATUS_SUCCESS);

in place of the example code

cairo_select_font_face(cr,"Sans",CAIRO_FONT_SLANT_NORMAL,CAIRO_FONT_WEIGHT_NORMAL);

Thx for any help.




More information about the cairo mailing list