how can I get all available fonts in the system (Linux) ?
I searched and found this: http://www.lemoda.net/pango/list-fonts/ but it's in C and depend on pango.
How can I do this in Python?
You can try using fc-list on ubuntu and then split every line by ":" to get all fonts on ubuntu http://manpages.ubuntu.com/manpages/hardy/man1/fc-list.1.html
map(lambda x : x.split(":")[1],commands.getstatusoutput('fc-list')[1].split("\n"))
While some of the font-names may contain symbols which python may not be able to print properly.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With