GFontBrowser: A Font Browser for Gnome
Background
If you have a large number of fonts installed on your system, you generally want to be able to browse them. The standard Gnome font selector can be used as a browser but it will only inform you of which fonts are findable with Fontconfig. The problem here is that if you have two versions of the same font, e.g. a PostScript Type 1 and a TrueType version of the same font, then you can only access one of the fonts – whichever the Fontconfig search finds first.
There are browsers such as gfontview but these are old programs that do not use Pango and Fontconfig so whilst they can be used for browsing fonts if you know where the files are, they really are not useful for finding out which fonts are on the Fontconfig path and which are the fonts available, i.e. not hidden to the Fontconfig search.
Solution
In early 2005, I wrote a zeroth draft of a program for browsing fonts where all fonts on the system in the Fontconfig paths are presented. The program isn't good, it definitely needs a lot more work on it but it was my first gtkmm program and the first time I worked with Fontconfig. It more or less does what I needed when I wrote the program and I haven't had need to evolve it, though it desparately needs it!
Despite its ‘unsophisticated’ state, people said I should release it under GPL so here it is. You can download the v0.1.2 tarball by clicking here. When I originally write this I was using Subversion as my version control system and gave the URL that people chould checkout from. Now though I have switched to using Bazaar, so instead of the Subversion repository URL that I originally had here, I now give the URL of the Bazaar branch: http://www.russel.org.uk/Bazaar/GFontBrowser_C++. This is a Bazaar branch with no working tree so if you browse the URL it will appear to be empty. If you find any problems or want to make any proposals for improvements, do let me know. Thanks.
Continuing work
2007-02-22, I added the facility to double click on a font and get the Gnome font viewer to display. Turned out to be quick and easy to do, and it adds significantly to the usefulness of GFontBrowser. Declared this to be version 0.1.3, there is a tarball here. For the adventurous there is the Bazaar branch at http://www.russel.org.uk/Bazaar/GFontBrowser_C++.
Disaster &ndash 2007-09-03
In changing from Ubuntu Edgy Eft to Feisty Fawn, and the consequent upgrade of GTK, GTKmm, Fontconfig, and Pango, a function that GFontBrowser relied on had its semantics changed from something sensible to “do nothing”. So GFontBrowser is now completely broken. Ggggrrrrrr........
The problem is the Fontconfig change. In moving from 2.3.x to 2.4.x, FcDirScan has been changed (though the documentation hasn't). As from 2.4.x this function does nothing and returns FcFalse – which is completely worse than useless – the function is being deprecated, but in the interim they have changed the semantics. Ho hum.
Clearly, this needs fixing. I am also going to take the opportunity to fix a long-standing problem with text rendering which means all use of Pango will go. Step 1 though was to move the code from Subversion to Bazaar. The Subversion repository is now no more, the code can be got using bzr by branching from http://www.russel.org.uk/Bazaar/GFontBrowser_C++.
A change of heart
Late in 2007 I was trying to tinker with GFontBrowser again to see what could be done to get around the decimation of Fontconfig functionality and decided to try rewriting the whole thing in Python instead of C++. Initially this was as much to learn about PyGTK as it was to progress GFontBrowser. It strikes me though that writing applications like this is so much easier in Python that in C++. So, at least for the moment, GFontBrowser is now a Python application. No release as yet but the Bazaar branch is at http://www.russel.org.uk/Bazaar/GFontBrowser_Python.