init: API

Dave Mitchell davem at iabyn.com
Sat Nov 19 13:43:07 UTC 2005


On Sat, Nov 19, 2005 at 11:16:24AM +0100, Nicolas Mailhot wrote:
> Once again, what is wrong with /etc/fonts/fonts.conf ?

Because my brain can't parse XML. I'm speaking as someone who recently
spent a lot of time messing with Ant files (XML/java based replacement for
make). A simple example from /etc/fonts/fonts.conf:

<!--
  Accept deprecated 'mono' alias, replacing it with 'monospace'
-->
        <match target="pattern">
                <test qual="any" name="family">
                        <string>mono</string>
                </test>
                <edit name="family" mode="assign">
                        <string>monospace</string>
                </edit>
        </match>

There are 22 words in that chunk, of which 3 are the important ones
(family/mono/monospace).  You can stare at that for minutes and what its
doing still doesn't leap out at you.

XML (like postscript) is good for situations where it isn't expected to
be handled by humans, and lousy where it is.

It's a bit like replacing the following C declaration:

    const char *s = "abc";

with

    <declaration-list>
	<declaration>
	    <name>s</name>
	    <type>char *</type>
	    <attribute-list>
		<attribute>const</attribute>
	    </attribute-list>
	    <initializer>"abc"</initializer>
	>
	</declaration>
    </declaration-list>

-- 
Little fly, thy summer's play my thoughtless hand
has terminated with extreme prejudice.
        (with apologies to William Blake)




More information about the fedora-devel-list mailing list