Listing GTK accessible fonts
كتبه خالد يوم 26 مارس 2008
I was trying to figure how to list fonts accessible to GTK (or pango actually), it turned out that pango.Context has a list_families() method that returns a tuple of pango.FontFamily objects.
Some thing like this:
window = gtk.Window()
context = window.get_pango_context()
families = context.list_families()
for i in families:
print i.get_name()
- قرأت 3997 مرة
التعليقات
علِّق