fonts.dtd 7.08 KB
Newer Older
Keith Packard's avatar
Keith Packard committed
1 2 3
<!-- This is the Document Type Definition for font configuration files -->
<!ELEMENT fontconfig (dir | 
		      cache | 
4
		      cachedir |
Keith Packard's avatar
Keith Packard committed
5 6
		      include | 
		      config |
7
		      selectfont |
Keith Packard's avatar
Keith Packard committed
8 9 10 11 12 13 14
		      match | 
		      alias)* >

<!-- 
    Add a directory that provides fonts
-->
<!ELEMENT dir (#PCDATA)>
15
<!ATTLIST dir
16
	  prefix    CDATA       "default"
17
	  xml:space (default|preserve) 'preserve'>
Keith Packard's avatar
Keith Packard committed
18 19 20 21 22 23 24 25 26 27

<!--
    Define the per-user file that holds cache font information.

    If the filename begins with '~', it is replaced with the users
    home directory path.
-->
<!ELEMENT cache (#PCDATA)>
<!ATTLIST cache xml:space (default|preserve) 'preserve'>

28 29 30 31 32 33 34 35 36 37
<!--
    Add a directory that is searched for font cache files.
    These hold per-directory cache data and are searched in
    order for each directory. When writing cache files, the first
    directory which allows the cache file to be created is used.

    A leading '~' in a directory name is replaced with the users
    home directory path.
-->
<!ELEMENT cachedir (#PCDATA)>
38
<!ATTLIST cachedir
39
	  prefix    CDATA      "default"
40
	  xml:space (default|preserve) 'preserve'>
41

Keith Packard's avatar
Keith Packard committed
42 43 44 45 46 47 48 49 50 51 52 53 54
<!--
    Reference another configuration file; note that this
    is another complete font configuration file and not
    just a file included by the XML parser.

    Set 'ignore_missing' to 'yes' if errors are to be ignored.

    If the filename begins with '~', it is replaced with the users
    home directory path.
-->
<!ELEMENT include (#PCDATA)>
<!ATTLIST include
	  ignore_missing    (no|yes)		"no"
55 56
	  prefix	    CDATA               "default"
	  deprecated	    (yes|no)		"no"
Keith Packard's avatar
Keith Packard committed
57 58 59 60 61
	  xml:space	    (default|preserve)	"preserve">

<!--
    Global library configuration data
 -->
62
<!ELEMENT config (blank|rescan)*>
Keith Packard's avatar
Keith Packard committed
63 64 65 66 67 68 69 70 71

<!--
    Specify the set of Unicode encoding values which
    represent glyphs that are allowed to contain no
    data.  With this list, fontconfig can examine
    fonts for broken glyphs and eliminate them from
    the set of valid Unicode chars.  This idea
    was borrowed from Mozilla
 -->
72
<!ELEMENT blank (int|range)*>
Keith Packard's avatar
Keith Packard committed
73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96

<!--
    Aliases are just a special case for multiple match elements

    They are syntactically equivalent to:

    <match>
	<test name="family">
	    <string value=[family]/>
	</test>
	<edit name="family" mode="prepend">
	    <string value=[prefer]/>
	    ...
	</edit>
	<edit name="family" mode="append">
	    <string value=[accept]/>
	    ...
	</edit>
	<edit name="family" mode="append_last">
	    <string value=[default]/>
	    ...
	</edit>
    </match>
-->
97 98 99 100 101 102
<!--
    Periodically rescan the font configuration and
    directories to synch internal state with filesystem
 -->
<!ELEMENT rescan (int)>

103 104 105 106 107 108 109 110 111 112 113 114 115
<!--
    Edit list of available fonts at startup/reload time
 -->
<!ELEMENT selectfont (rejectfont | acceptfont)* >

<!ELEMENT rejectfont (glob | pattern)*>

<!ELEMENT acceptfont (glob | pattern)*>

<!ELEMENT glob (#PCDATA)>

<!ELEMENT pattern (patelt)*>

116
<!ENTITY % constant 'int|double|string|matrix|bool|charset|langset|const'>
117 118

<!ELEMENT patelt (%constant;)*>
119 120 121
<!ATTLIST patelt
	  name CDATA	#REQUIRED>

122
<!ELEMENT alias (test?, family*, prefer?, accept?, default?)>
123 124
<!ATTLIST alias
	  binding (weak|strong|same) "weak">
Keith Packard's avatar
Keith Packard committed
125 126 127 128 129 130
<!ELEMENT prefer (family)*>
<!ELEMENT accept (family)*>
<!ELEMENT default (family)*>
<!ELEMENT family (#PCDATA)>
<!ATTLIST family xml:space (default|preserve) 'preserve'>

131
<!ENTITY % expr 'int|double|string|matrix|bool|charset|langset
Keith Packard's avatar
Keith Packard committed
132
		|name|const
133
		|or|and|eq|not_eq|less|less_eq|more|more_eq|contains|not_contains
134
		|plus|minus|times|divide|not|if|floor|ceil|round|trunc'>
Keith Packard's avatar
Keith Packard committed
135 136 137 138 139 140 141 142

<!--
    Match and edit patterns.

    If 'target' is 'pattern', execute the match before selecting a font.
    if 'target' is 'font', execute the match on the result of a font
    selection.
-->
Akira TAGOH's avatar
Akira TAGOH committed
143
<!ELEMENT match (test|edit)+>
Keith Packard's avatar
Keith Packard committed
144
<!ATTLIST match
145
	  target (pattern|font|scan) "pattern">
Keith Packard's avatar
Keith Packard committed
146 147 148 149 150 151

<!--
    Match a field in a pattern

    if 'qual' is 'any', then the match succeeds if any value in the field matches.
    if 'qual' is 'all', then the match succeeds only if all values match.
152 153 154
    if 'qual' is 'first', then the match succeeds only if the first value matches.
    if 'qual' is 'not_first', then the match succeeds only if any value other than
    	the first matches.
155 156 157
    For match elements with target=font, if test 'target' is 'pattern',
    then the test is applied to the pattern used in matching rather than
    to the resulting font.
158 159 160 161

    Match elements with target=scan are applied as fonts are scanned.
    They edit the pattern generated from the scanned font and affect
    what the fontconfig database contains.
Keith Packard's avatar
Keith Packard committed
162
-->
163
<!ELEMENT test (%expr;)*>
Keith Packard's avatar
Keith Packard committed
164
<!ATTLIST test 
165
	  qual (any|all|first|not_first)    "any"
Keith Packard's avatar
Keith Packard committed
166
	  name CDATA	    #REQUIRED
167
	  target (pattern|font|default)		"default"
168
	  ignore-blanks (true|false)	"false"
169
	  compare (eq|not_eq|less|less_eq|more|more_eq|contains|not_contains)	"eq">
Keith Packard's avatar
Keith Packard committed
170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191

<!--
    Edit a field in a pattern

    The enclosed values are used together to edit the list of values
    associated with 'name'.

    If 'name' matches one of those used in a test element for this match element:
	if 'mode' is 'assign', replace the matched value.
	if 'mode' is 'assign_replace', replace all of the values
	if 'mode' is 'prepend', insert before the matched value
	if 'mode' is 'append', insert after the matched value
	if 'mode' is 'prepend_first', insert before all of the values
	if 'mode' is 'append_last', insert after all of the values
    If 'name' doesn't match any of those used in a test element:
	if 'mode' is 'assign' or 'assign_replace, replace all of the values
	if 'mode' is 'prepend' or 'prepend_first', insert before all of the values
	if 'mode' is 'append' or 'append_last', insert after all of the values
-->
<!ELEMENT edit (%expr;)*>
<!ATTLIST edit
	  name CDATA	    #REQUIRED
192
	  mode (assign|assign_replace|prepend|append|prepend_first|append_last|delete|delete_all) "assign"
193
	  binding (weak|strong|same) "weak">
Keith Packard's avatar
Keith Packard committed
194 195 196 197 198 199 200 201 202 203

<!--
    Elements of expressions follow
-->
<!ELEMENT int (#PCDATA)>
<!ATTLIST int xml:space (default|preserve) 'preserve'>
<!ELEMENT double (#PCDATA)>
<!ATTLIST double xml:space (default|preserve) 'preserve'>
<!ELEMENT string (#PCDATA)>
<!ATTLIST string xml:space (default|preserve) 'preserve'>
204
<!ELEMENT matrix ((%expr;), (%expr;), (%expr;), (%expr;))>
205
<!ELEMENT bool (#PCDATA)>
206 207
<!ELEMENT charset (int|range)*>
<!ELEMENT range (int,int)>
208
<!ELEMENT langset (string)*>
Keith Packard's avatar
Keith Packard committed
209
<!ELEMENT name (#PCDATA)>
210 211
<!ATTLIST name xml:space (default|preserve) 'preserve'
	  target (default|font|pattern) 'default'>
Keith Packard's avatar
Keith Packard committed
212 213 214 215 216 217 218 219 220 221
<!ELEMENT const (#PCDATA)>
<!ATTLIST const xml:space (default|preserve) 'preserve'>
<!ELEMENT or (%expr;)*>
<!ELEMENT and (%expr;)*>
<!ELEMENT eq ((%expr;), (%expr;))>
<!ELEMENT not_eq ((%expr;), (%expr;))>
<!ELEMENT less ((%expr;), (%expr;))>
<!ELEMENT less_eq ((%expr;), (%expr;))>
<!ELEMENT more ((%expr;), (%expr;))>
<!ELEMENT more_eq ((%expr;), (%expr;))>
222 223
<!ELEMENT contains ((%expr;), (%expr;))>
<!ELEMENT not_contains ((%expr;), (%expr;))>
Keith Packard's avatar
Keith Packard committed
224 225 226 227 228 229
<!ELEMENT plus (%expr;)*>
<!ELEMENT minus (%expr;)*>
<!ELEMENT times (%expr;)*>
<!ELEMENT divide (%expr;)*>
<!ELEMENT not (%expr;)>
<!ELEMENT if ((%expr;), (%expr;), (%expr;))>
230 231 232 233
<!ELEMENT floor (%expr;)>
<!ELEMENT ceil (%expr;)>
<!ELEMENT round (%expr;)>
<!ELEMENT trunc (%expr;)>