--- author: '' category: '' date: 2009/09/30 00:07 description: '' link: '' priority: '' slug: BB838 tags: programming, python title: Dear Lazyweb, what's the pythonic cross-platform fc-match? type: text updated: 2009/09/30 00:07 url_type: '' --- 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? .. _font_manager: http://matplotlib.sourceforge.net/api/font_manager_api.html