PyFontSel: simple GTK font selection tool
People, you would not believe how hard it is, apparently, to find a simple font selection dialog. You know, the kind that appears in various applications when you need to select a font, except I wanted a standalone dialog, a sort of xfontsel alternative, but something done in GTK+ 2.0 or Qt, to get nice antialised fonts.
Why would I need such a thing? To quickly browse the fonts on my system! For instance, I wanted to change the font in my terminal. It’s a very simple terminal application, with no frills, and doesn’t have its own font selection dialog (or any dialog, for that matter). So how am I supposed to look around and see what font I’d like? I don’t particularly enjoy using xfontsel and I don’t think I’m alone there…
So I looked around and what do you know, I couldn’t find any such thing! It’s maddening. It’s such a simple thing to do (one page of code) that apparently nobody bothered to do it. The only things I could find were xfontsel and the ancient gtkfontsel, which is built upon GTK+ v1.0, does not antialias fonts and generally looks and is outdated.
Long story short, I wrote the damn thing myself, in Python. It’s called PyFontSel, it’s permissively licensed and you can download it here. It simply calls forth the GTK font selection dialog, so it will evolve automatically as that dialog evolves.
Save it somewhere and then either chmod to make it executable and run it directly, or run it via python, from the command line, like this: “python pyfontsel.py”. Enjoy.
