Please add <group> → <generic>
This is a part of: #200
Preamble
The ordering model defined in #194 requires clear identification of generic families. As far as I know (but I may be wrong), fontconfig does not know what its generics are today – they are just substitution patterns that happen to never match real font files.
Purpose
Using generic
instead of target
makes an group
block a generic declaration.
<?xml version="1.0"?>
<!DOCTYPE fontconfig SYSTEM "fonts.dtd">
<!-- SPDX-License-Identifier: MIT -->
<fontconfig>
<group>
<generic>@generic_family_name@</generic>
</group>
</fontconfig>
Behaviour
generic
is incompatible with target
. The group
blocks for a font family can either contain generic
or target
but not both (both is a syntax error).
generic
is incompatible with family
and match
. A generic, is not supposed to match real font files.
fontconfig rejects any font file, that declares a generic name, as its family
(unless remapped to something else in another group
block).
A fontconfig command returns the list of generics known to a fontconfig installation, so users can query the classification model in use before writing new fontconfig rules (similar to the way iconv --list
returns the encoding names it currently understands).
The top level group
+ like
declaration for a given generic family, corresponds to the default system fonts.
Minimal example
<?xml version="1.0"?>
<!DOCTYPE fontconfig SYSTEM "fonts.dtd">
<!-- SPDX-License-Identifier: MIT -->
<fontconfig>
<group>
<generic>serif</generic>
<like>
<family>DejaVu Serif</family>
<family>Noto Serif</family>
</like>
</group>
</fontconfig>