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

Smart fonts vs. dumb fonts

'Update: I rewrote this post and changed its title from Pango vs.

Webkit rendering Arabic

Webkit rendering Arabic

WebKit-r29336 using Pango for font rendering, enabling Arabic and other complex text rendering.

Nafees Nastaleeq font rendered by Pango (in Gedit)

Nafees Nastaleeq font rendered by Pango (in Gedit)

How beautiful is that!

لَقِّم المحتوى