Listing GTK accessible fonts

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()

التعليقات

علِّق

محتويات هذا الحقل سرية ولن تظهر للآخرين.
  • You can use Mediawiki syntax. It is possible that not all formatting options are supported at the moment.
    Links to other pages: [[Page Title]] or [[path/to/page|Title]].
    External links: http://example.com or [http://example.com some link title].
    Interwiki links: [[site:Page Title]].
    You can use the following interwiki links: path, gdo, wp, ع

  • You may write mixed Arabic and English freely, line direction will be computed automaticaly

معلومات أكثر عن خيارات التنسيق

كابتشا
هذا السؤال للتأكد من أنك زائر من لحم ودم ولمنع رسائل السخام.
5 + 0 =
حل مسألة الرساضيّات البسيطة هذه وأدخل الناتج. مثلا. أدخل 4 في حالة 1+3.