[Fontconfig] DTD

Lawrence D'Oliveiro ldo at geek-central.gen.nz
Fri Mar 30 22:04:44 UTC 2018

On Fri, 30 Mar 2018 18:41:34 +0000, Jerry Casiano wrote:

> I would consider [the lack of a DTD] a bug if I used Debian.

Does anybody still use DTDs for anything? They may have made sense with
SGML, but HTML, for example, does so much more with CSS instead. And as
for XML, it seems to me a DTD is neither necessary nor sufficient to
capture the semantics of most real-world applications.

Fontconfig being a case in point: half of fonts.dtd is comments
explaining what the constructs actually mean. And much of the rest is
essentially content-free syntax like

    <!ELEMENT dir (#PCDATA)>
    <!ELEMENT family (#PCDATA)>
    <!ELEMENT int (#PCDATA)>
    <!ELEMENT double (#PCDATA)>
    <!ELEMENT string (#PCDATA)>
    <!ELEMENT bool (#PCDATA)>
    <!ELEMENT const (#PCDATA)>

And things like

    <!ELEMENT plus (%expr;)*>
    <!ELEMENT minus (%expr;)*>
    <!ELEMENT times (%expr;)*>
    <!ELEMENT divide (%expr;)*>
    <!ELEMENT not (%expr;)>

convey that these operators are recognized and can take multiple
operands, but nothing more.

More information about the Fontconfig mailing list