fonts.dtd revision 2c393a42
12c393a42Smrg<!-- This is the Document Type Definition for font configuration files -->
22c393a42Smrg<!ELEMENT fontconfig (dir | 
32c393a42Smrg		      cache | 
42c393a42Smrg		      cachedir |
52c393a42Smrg		      include | 
62c393a42Smrg		      config |
72c393a42Smrg		      selectfont |
82c393a42Smrg		      match | 
92c393a42Smrg		      alias)* >
102c393a42Smrg
112c393a42Smrg<!-- 
122c393a42Smrg    Add a directory that provides fonts
132c393a42Smrg-->
142c393a42Smrg<!ELEMENT dir (#PCDATA)>
152c393a42Smrg<!ATTLIST dir xml:space (default|preserve) 'preserve'>
162c393a42Smrg
172c393a42Smrg<!--
182c393a42Smrg    Define the per-user file that holds cache font information.
192c393a42Smrg
202c393a42Smrg    If the filename begins with '~', it is replaced with the users
212c393a42Smrg    home directory path.
222c393a42Smrg-->
232c393a42Smrg<!ELEMENT cache (#PCDATA)>
242c393a42Smrg<!ATTLIST cache xml:space (default|preserve) 'preserve'>
252c393a42Smrg
262c393a42Smrg<!--
272c393a42Smrg    Add a directory that is searched for font cache files.
282c393a42Smrg    These hold per-directory cache data and are searched in
292c393a42Smrg    order for each directory. When writing cache files, the first
302c393a42Smrg    directory which allows the cache file to be created is used.
312c393a42Smrg
322c393a42Smrg    A leading '~' in a directory name is replaced with the users
332c393a42Smrg    home directory path.
342c393a42Smrg-->
352c393a42Smrg<!ELEMENT cachedir (#PCDATA)>
362c393a42Smrg<!ATTLIST cachedir xml:space (default|preserve) 'preserve'>
372c393a42Smrg
382c393a42Smrg<!--
392c393a42Smrg    Reference another configuration file; note that this
402c393a42Smrg    is another complete font configuration file and not
412c393a42Smrg    just a file included by the XML parser.
422c393a42Smrg
432c393a42Smrg    Set 'ignore_missing' to 'yes' if errors are to be ignored.
442c393a42Smrg
452c393a42Smrg    If the filename begins with '~', it is replaced with the users
462c393a42Smrg    home directory path.
472c393a42Smrg-->
482c393a42Smrg<!ELEMENT include (#PCDATA)>
492c393a42Smrg<!ATTLIST include
502c393a42Smrg	  ignore_missing    (no|yes)		"no"
512c393a42Smrg	  xml:space	    (default|preserve)	"preserve">
522c393a42Smrg
532c393a42Smrg<!--
542c393a42Smrg    Global library configuration data
552c393a42Smrg -->
562c393a42Smrg<!ELEMENT config (blank|rescan)*>
572c393a42Smrg
582c393a42Smrg<!--
592c393a42Smrg    Specify the set of Unicode encoding values which
602c393a42Smrg    represent glyphs that are allowed to contain no
612c393a42Smrg    data.  With this list, fontconfig can examine
622c393a42Smrg    fonts for broken glyphs and eliminate them from
632c393a42Smrg    the set of valid Unicode chars.  This idea
642c393a42Smrg    was borrowed from Mozilla
652c393a42Smrg -->
662c393a42Smrg<!ELEMENT blank (int)*>
672c393a42Smrg
682c393a42Smrg<!--
692c393a42Smrg    Aliases are just a special case for multiple match elements
702c393a42Smrg
712c393a42Smrg    They are syntactically equivalent to:
722c393a42Smrg
732c393a42Smrg    <match>
742c393a42Smrg	<test name="family">
752c393a42Smrg	    <string value=[family]/>
762c393a42Smrg	</test>
772c393a42Smrg	<edit name="family" mode="prepend">
782c393a42Smrg	    <string value=[prefer]/>
792c393a42Smrg	    ...
802c393a42Smrg	</edit>
812c393a42Smrg	<edit name="family" mode="append">
822c393a42Smrg	    <string value=[accept]/>
832c393a42Smrg	    ...
842c393a42Smrg	</edit>
852c393a42Smrg	<edit name="family" mode="append_last">
862c393a42Smrg	    <string value=[default]/>
872c393a42Smrg	    ...
882c393a42Smrg	</edit>
892c393a42Smrg    </match>
902c393a42Smrg-->
912c393a42Smrg<!--
922c393a42Smrg    Periodically rescan the font configuration and
932c393a42Smrg    directories to synch internal state with filesystem
942c393a42Smrg -->
952c393a42Smrg<!ELEMENT rescan (int)>
962c393a42Smrg
972c393a42Smrg<!--
982c393a42Smrg    Edit list of available fonts at startup/reload time
992c393a42Smrg -->
1002c393a42Smrg<!ELEMENT selectfont (rejectfont | acceptfont)* >
1012c393a42Smrg
1022c393a42Smrg<!ELEMENT rejectfont (glob | pattern)*>
1032c393a42Smrg
1042c393a42Smrg<!ELEMENT acceptfont (glob | pattern)*>
1052c393a42Smrg
1062c393a42Smrg<!ELEMENT glob (#PCDATA)>
1072c393a42Smrg
1082c393a42Smrg<!ELEMENT pattern (patelt)*>
1092c393a42Smrg
1102c393a42Smrg<!ENTITY % constant 'int|double|string|matrix|bool|charset|const'>
1112c393a42Smrg
1122c393a42Smrg<!ELEMENT patelt (%constant;)*>
1132c393a42Smrg<!ATTLIST patelt
1142c393a42Smrg	  name CDATA	#REQUIRED>
1152c393a42Smrg
1162c393a42Smrg<!ELEMENT alias (family*, prefer?, accept?, default?)>
1172c393a42Smrg<!ATTLIST alias
1182c393a42Smrg	  binding (weak|strong|same) "weak">
1192c393a42Smrg<!ELEMENT prefer (family)*>
1202c393a42Smrg<!ELEMENT accept (family)*>
1212c393a42Smrg<!ELEMENT default (family)*>
1222c393a42Smrg<!ELEMENT family (#PCDATA)>
1232c393a42Smrg<!ATTLIST family xml:space (default|preserve) 'preserve'>
1242c393a42Smrg
1252c393a42Smrg<!ENTITY % expr 'int|double|string|matrix|bool|charset
1262c393a42Smrg		|name|const
1272c393a42Smrg		|or|and|eq|not_eq|less|less_eq|more|more_eq|contains|not_contains
1282c393a42Smrg		|plus|minus|times|divide|not|if|floor|ceil|round|trunc'>
1292c393a42Smrg
1302c393a42Smrg<!--
1312c393a42Smrg    Match and edit patterns.
1322c393a42Smrg
1332c393a42Smrg    If 'target' is 'pattern', execute the match before selecting a font.
1342c393a42Smrg    if 'target' is 'font', execute the match on the result of a font
1352c393a42Smrg    selection.
1362c393a42Smrg-->
1372c393a42Smrg<!ELEMENT match (test*, edit*)>
1382c393a42Smrg<!ATTLIST match
1392c393a42Smrg	  target (pattern|font|scan) "pattern">
1402c393a42Smrg
1412c393a42Smrg<!--
1422c393a42Smrg    Match a field in a pattern
1432c393a42Smrg
1442c393a42Smrg    if 'qual' is 'any', then the match succeeds if any value in the field matches.
1452c393a42Smrg    if 'qual' is 'all', then the match succeeds only if all values match.
1462c393a42Smrg    if 'qual' is 'first', then the match succeeds only if the first value matches.
1472c393a42Smrg    if 'qual' is 'not_first', then the match succeeds only if any value other than
1482c393a42Smrg    	the first matches.
1492c393a42Smrg    For match elements with target=font, if test 'target' is 'pattern',
1502c393a42Smrg    then the test is applied to the pattern used in matching rather than
1512c393a42Smrg    to the resulting font.
1522c393a42Smrg
1532c393a42Smrg    Match elements with target=scan are applied as fonts are scanned.
1542c393a42Smrg    They edit the pattern generated from the scanned font and affect
1552c393a42Smrg    what the fontconfig database contains.
1562c393a42Smrg-->
1572c393a42Smrg<!ELEMENT test (%expr;)*>
1582c393a42Smrg<!ATTLIST test 
1592c393a42Smrg	  qual (any|all|first|not_first)    "any"
1602c393a42Smrg	  name CDATA	    #REQUIRED
1612c393a42Smrg	  target (pattern|font|default)		"default"
1622c393a42Smrg	  compare (eq|not_eq|less|less_eq|more|more_eq|contains|not_contains)	"eq">
1632c393a42Smrg
1642c393a42Smrg<!--
1652c393a42Smrg    Edit a field in a pattern
1662c393a42Smrg
1672c393a42Smrg    The enclosed values are used together to edit the list of values
1682c393a42Smrg    associated with 'name'.
1692c393a42Smrg
1702c393a42Smrg    If 'name' matches one of those used in a test element for this match element:
1712c393a42Smrg	if 'mode' is 'assign', replace the matched value.
1722c393a42Smrg	if 'mode' is 'assign_replace', replace all of the values
1732c393a42Smrg	if 'mode' is 'prepend', insert before the matched value
1742c393a42Smrg	if 'mode' is 'append', insert after the matched value
1752c393a42Smrg	if 'mode' is 'prepend_first', insert before all of the values
1762c393a42Smrg	if 'mode' is 'append_last', insert after all of the values
1772c393a42Smrg    If 'name' doesn't match any of those used in a test element:
1782c393a42Smrg	if 'mode' is 'assign' or 'assign_replace, replace all of the values
1792c393a42Smrg	if 'mode' is 'prepend' or 'prepend_first', insert before all of the values
1802c393a42Smrg	if 'mode' is 'append' or 'append_last', insert after all of the values
1812c393a42Smrg-->
1822c393a42Smrg<!ELEMENT edit (%expr;)*>
1832c393a42Smrg<!ATTLIST edit
1842c393a42Smrg	  name CDATA	    #REQUIRED
1852c393a42Smrg	  mode (assign|assign_replace|prepend|append|prepend_first|append_last) "assign"
1862c393a42Smrg	  binding (weak|strong|same) "weak">
1872c393a42Smrg
1882c393a42Smrg<!--
1892c393a42Smrg    Elements of expressions follow
1902c393a42Smrg-->
1912c393a42Smrg<!ELEMENT int (#PCDATA)>
1922c393a42Smrg<!ATTLIST int xml:space (default|preserve) 'preserve'>
1932c393a42Smrg<!ELEMENT double (#PCDATA)>
1942c393a42Smrg<!ATTLIST double xml:space (default|preserve) 'preserve'>
1952c393a42Smrg<!ELEMENT string (#PCDATA)>
1962c393a42Smrg<!ATTLIST string xml:space (default|preserve) 'preserve'>
1972c393a42Smrg<!ELEMENT matrix (double,double,double,double)>
1982c393a42Smrg<!ELEMENT bool (#PCDATA)>
1992c393a42Smrg<!ELEMENT charset (#PCDATA)>
2002c393a42Smrg<!ATTLIST charset xml:space (default|preserve) 'preserve'>
2012c393a42Smrg<!ELEMENT name (#PCDATA)>
2022c393a42Smrg<!ATTLIST name xml:space (default|preserve) 'preserve'>
2032c393a42Smrg<!ELEMENT const (#PCDATA)>
2042c393a42Smrg<!ATTLIST const xml:space (default|preserve) 'preserve'>
2052c393a42Smrg<!ELEMENT or (%expr;)*>
2062c393a42Smrg<!ELEMENT and (%expr;)*>
2072c393a42Smrg<!ELEMENT eq ((%expr;), (%expr;))>
2082c393a42Smrg<!ELEMENT not_eq ((%expr;), (%expr;))>
2092c393a42Smrg<!ELEMENT less ((%expr;), (%expr;))>
2102c393a42Smrg<!ELEMENT less_eq ((%expr;), (%expr;))>
2112c393a42Smrg<!ELEMENT more ((%expr;), (%expr;))>
2122c393a42Smrg<!ELEMENT more_eq ((%expr;), (%expr;))>
2132c393a42Smrg<!ELEMENT contains ((%expr;), (%expr;))>
2142c393a42Smrg<!ELEMENT not_contains ((%expr;), (%expr;))>
2152c393a42Smrg<!ELEMENT plus (%expr;)*>
2162c393a42Smrg<!ELEMENT minus (%expr;)*>
2172c393a42Smrg<!ELEMENT times (%expr;)*>
2182c393a42Smrg<!ELEMENT divide (%expr;)*>
2192c393a42Smrg<!ELEMENT not (%expr;)>
2202c393a42Smrg<!ELEMENT if ((%expr;), (%expr;), (%expr;))>
2212c393a42Smrg<!ELEMENT floor (%expr;)>
2222c393a42Smrg<!ELEMENT ceil (%expr;)>
2232c393a42Smrg<!ELEMENT round (%expr;)>
2242c393a42Smrg<!ELEMENT trunc (%expr;)>
225