Le 19/05/2010 00:33, Khaled Hosny a écrit : > On Wed, May 19, 2010 at 12:19:25AM +0300, Elie Roux wrote: >> Khaled Hosny a écrit : >>> Another option is to find Apple font configuration files (which are >>> likely to be some sort of XML) and try to parse it directly, and the >>> same for FC, but we still need an XML library (but this can be easier >>> since context has one ;). >> >> Am I the only one finding this extremely ugly? > > Because running a command line tool and then parsing its non-standard > output (non-standard in the way that it was never meant to be machine > readable and can change without prior notice) is much more uglier, but > reading a configuration file is not. > I agree with Khaled. If al we need is the list of directories, then reading the configuration file sounds like a good option.
>> Anyway, while we are >> in ugliness, I don't really see why we need some sort of xml library >> to parse the configuration files, some regexp will do the trick very >> easily (for the fonts.conf of fc at least). > > Because I neither know XML nor regular expressions (unless very > superficial knowledge is counted.) > While it is generally a bad idea to try parsing XML using regexes, I think it would be possible to retrieve the information in this particular case using regexes rather than a full-fledge XML parser. Manuel.
