[pygtk] setting a filter for gtk.FontSelection

Le Roux Bodenstein lerouxb at gmail.com
Mon May 5 17:04:37 WST 2008


>  Retrieve the pango context from the main widget and then get the list of
> the font families in the pango context and filter them for monospace fonts
> e.g.:
>
>  context = gtk.Window().get_pango_context()
>  monofonts = [fam for fam in context.list_families() if fam.is_monospace()]


Thanks! Wow - that's really easy.


More information about the pygtk mailing list