fontconfig/fonts.dtd

250 lines
7.7 KiB
DTD
Raw Normal View History

2002-02-15 00:34:13 +01:00
<!-- This is the Document Type Definition for font configuration files -->
<!ELEMENT fontconfig (alias |
2002-02-15 00:34:13 +01:00
cache |
cachedir |
2002-02-15 00:34:13 +01:00
config |
description |
dir |
include |
match |
selectfont)* >
2002-02-15 00:34:13 +01:00
<!--
Add a directory that provides fonts
-->
<!ELEMENT dir (#PCDATA)>
<!ATTLIST dir
Replace UUID file mechanism with per-directory 'map' attribute [v2] The UUID files would be placed in each font directory to provide the unique cache name, independent of path, for that directory. The UUID files are undesireable for a couple of reasons: 1) They must be placed in the font directories to be useful. This requires modifying the font directories themselves, introducing potential visible timestamp changes when running multiple applications, and makes the cache processing inconsistent between applications with permission to write to the font directories and applications without such permission. 2) The UUID contents were generated randomly, which makes the font cache not reproducible across multiple runs. One proposed fix for 2) is to make the UUID dependent on the font directory path, but once we do that, we can simply use the font directory path itself as the key as the original MD5-based font cache naming mechanism did. The goal of the UUID file mechanism was to fix startup time of flatpaks; as the font path names inside the flatpak did not match the font path names in the base system, the font cache would need to be reconstructed the first time the flatpak was launched. The new mechanism for doing this is to allow each '<dir>' element in the configuration include a 'map' attribute. When looking for a cache file for a particular directory, if the directory name starts with the contents of the <dir> element, that portion of the name will be replaced with the value of the 'map' attribute. Outside of the flatpak, nothing need change -- fontconfig will build cache files using real directory names. Inside the flatpak, the custom fonts.conf file will now include mappings such as this: <dir map="/usr/share/fonts">/run/host/fonts</dir> When scanning the directory /run/host/fonts/ttf, fontconfig will use the name /usr/share/fonts/ttf as the source for building the cache file name. The existing FC_FILE replacement code used for the UUID-based implementation continues to correctly adapt font path names seen by applications. v2: Leave FcDirCacheCreateUUID stub around to avoid removing public API function. Document 'map' attribute of <dir> element in fontconfig-user.sgml Suggested-by: Akira TAGOH <akira@tagoh.org> Signed-off-by: Keith Packard <keithp@keithp.com>
2018-10-30 00:39:05 +01:00
map CDATA #IMPLIED
2018-10-04 10:02:18 +02:00
prefix (default|xdg|relative|cwd) "default"
xml:space (default|preserve) 'preserve'>
2002-02-15 00:34:13 +01:00
<!--
Define the per-user file that holds cache font information.
If the filename begins with '~', it is replaced with the users
home directory path.
2018-10-04 10:02:18 +02:00
If 'prefix' is 'default' or 'cwd', then the current working directory will be added prior to the value.
If 'prefix' is 'xdg', then the value in the $XDG_DATA_HOME will be added prior to the value.
If 'prefix' is 'relative', then the path of curent file will be added prior to the value.
2002-02-15 00:34:13 +01:00
-->
<!ELEMENT cache (#PCDATA)>
<!ATTLIST cache xml:space (default|preserve) 'preserve'>
<!--
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)>
<!ATTLIST cachedir
prefix CDATA "default"
xml:space (default|preserve) 'preserve'>
<!--
Set a string as a description for the targeted config file
Set 'domain' to change where to pull translations from.
This will be done through gettext.
-->
<!ELEMENT description (#PCDATA)>
<!ATTLIST description
domain CDATA "fontconfig-conf">
2002-02-15 00:34:13 +01:00
<!--
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"
prefix CDATA "default"
deprecated (yes|no) "no"
2002-02-15 00:34:13 +01:00
xml:space (default|preserve) "preserve">
<!--
Global library configuration data
-->
<!ELEMENT config (blank|rescan)*>
2002-02-15 00:34:13 +01:00
<!--
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
-->
<!ELEMENT blank (int|range)*>
2002-02-15 00:34:13 +01:00
<!--
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>
-->
2002-05-21 19:08:42 +02:00
<!--
Periodically rescan the font configuration and
directories to synch internal state with filesystem
-->
<!ELEMENT rescan (int)>
<!--
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)*>
<!ENTITY % constant 'int|double|string|matrix|bool|charset|langset|const'>
<!ELEMENT patelt (%constant;)*>
<!ATTLIST patelt
name CDATA #REQUIRED>
<!ELEMENT alias (test?, family*, prefer?, accept?, default?)>
<!ATTLIST alias
binding (weak|strong|same) "weak">
2002-02-15 00:34:13 +01:00
<!ELEMENT prefer (family)*>
<!ELEMENT accept (family)*>
<!ELEMENT default (family)*>
<!ELEMENT family (#PCDATA)>
<!ATTLIST family xml:space (default|preserve) 'preserve'>
<!ENTITY % expr 'int|double|string|matrix|bool|charset|langset
2002-02-15 00:34:13 +01:00
|name|const
|or|and|eq|not_eq|less|less_eq|more|more_eq|contains|not_contains
|plus|minus|times|divide|not|if|floor|ceil|round|trunc'>
2002-02-15 00:34:13 +01:00
<!--
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.
-->
2013-10-31 14:12:26 +01:00
<!ELEMENT match (test|edit)+>
2002-02-15 00:34:13 +01:00
<!ATTLIST match
target (pattern|font|scan) "pattern">
2002-02-15 00:34:13 +01:00
<!--
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.
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.
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.
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.
2002-02-15 00:34:13 +01:00
-->
2002-05-21 19:08:42 +02:00
<!ELEMENT test (%expr;)*>
2002-02-15 00:34:13 +01:00
<!ATTLIST test
qual (any|all|first|not_first) "any"
2002-02-15 00:34:13 +01:00
name CDATA #REQUIRED
target (pattern|font|default) "default"
ignore-blanks (true|false) "false"
compare (eq|not_eq|less|less_eq|more|more_eq|contains|not_contains) "eq">
2002-02-15 00:34:13 +01:00
<!--
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
mode (assign|assign_replace|prepend|append|prepend_first|append_last|delete|delete_all) "assign"
binding (weak|strong|same) "weak">
2002-02-15 00:34:13 +01:00
<!--
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'>
<!ELEMENT matrix ((%expr;), (%expr;), (%expr;), (%expr;))>
2003-04-16 18:18:27 +02:00
<!ELEMENT bool (#PCDATA)>
<!ELEMENT charset (int|range)*>
<!ELEMENT range (int,int)>
<!ELEMENT langset (string)*>
2002-02-15 00:34:13 +01:00
<!ELEMENT name (#PCDATA)>
<!ATTLIST name xml:space (default|preserve) 'preserve'
target (default|font|pattern) 'default'>
2002-02-15 00:34:13 +01:00
<!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;))>
<!ELEMENT contains ((%expr;), (%expr;))>
<!ELEMENT not_contains ((%expr;), (%expr;))>
2002-02-15 00:34:13 +01:00
<!ELEMENT plus (%expr;)*>
<!ELEMENT minus (%expr;)*>
<!ELEMENT times (%expr;)*>
<!ELEMENT divide (%expr;)*>
<!ELEMENT not (%expr;)>
<!ELEMENT if ((%expr;), (%expr;), (%expr;))>
<!ELEMENT floor (%expr;)>
<!ELEMENT ceil (%expr;)>
<!ELEMENT round (%expr;)>
<!ELEMENT trunc (%expr;)>