Re: PangoFontDescription to PangoFont



On 08/31/04 17:05, Boncek, John wrote:
Anybody know how to get a PangoFont given a PangoFontDescription?  I've
searched high and low thru the documentation and on the web and can't find
a transformation.  Or is this not a valid thing to do, perhaps because it
requires more information?  Any help would be appreciated.

it does and it doesn't.  pango_font_map_load_font() will get you a PangoFont,
but it needs two things:

a PangoFontMap.  this is backend-specific, for example, if you're using the
xft backend, you'd use pango_xft_font_map_new().

a PangoContext.  if you already have one of these lying around, you can
probably use it.  otherwise, the fontmap classes can create one for you, e.g.,
pango_xft_get_context().

i haven't actually verified that this works properly, but it seems like it
should.  (btw, i got all this from 5 minutes perusing the pango API docs.)

        -brian



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