[cairo] Re: Drawing text with Windows bitmap fonts

Jan Slupski jslupski at gmail.com
Mon Jan 22 17:56:04 PST 2007


Hi all,

I would like to refresh a topic from a year ago:

Stuart Parmenter wrote:
 > Has anyone gotten win32 bitmap fonts to render using cairo?  I'm using
 > cairo_show_glyphs() with glyph indexes I've gotten from Uniscribe.
 > Things fall apart in _cairo_win32_scaled_font_init_glyph_metrics in
 > cairo-win32-font.c when it tries to do GetGlyphOutlineW().  According
 > to the MSDN docs, using GGO_GLYPH_INDEX means that it is a true type
 > index, which I'm not sure if bitmap fonts really respect.
 > GetGlyphOutlineW ends up failing...  I could be going down the wrong
 > path here.. was wondering if anyone else had done more digging or had
 > any suggestions.

Indeed, it seems that support for bitmap fonts is somewhat broken.
I am trying to open Windows font called "Small Fonts" (smalle.fon).

As stated above, cairo is using _scaled_* functions to operate
on that font that seems to be wrong by definition.
This ends up on querying the font with GetGlyphOutlineW that
by MSDN definition "The GetGlyphOutline function retrieves the outline 
or bitmap for a character in the *TrueType* font".

I think cairo should either properly support windows bitmap fonts 
(ignoring font size & rotation?), or fail in more meaningful way. It 
could be either return of an error by cairo's API call, or fallback to a 
default font in the same way as when unknown font name is passed.

Regards,
Jan



More information about the cairo mailing list