Dear Lazyweb, what's the pythonic cross-platform fc-match?

Here's what fc-match does:

$ fc-match "Droid Sans"
DroidSans.ttf: "Droid Sans" "Regular"

Or even:

$ fc-match "Droid Sans" -v | grep file:
      file: "/usr/share/fonts/TTF/DroidSans.ttf"

So, how does one do that, going from a font family name or font name to a font file, where there's no fontconfig?

I found code for this in matplotlib's font_manager module but it looks hard to untangle, and requiring matplotlib is a bit over the top.

If there's no portable solution, I would be happy enough with three standalone solutions instead, and promise to publish an abstraction layer over them ;-)

So, dear windows and mac pythonistas, any pointers?


Comments powered by Disqus