Please add <group> → <target>
This is a part of: #200
target element specifies the
@canonical_family_name@ being assembled.
<?xml version="1.0"?> <!DOCTYPE fontconfig SYSTEM "fonts.dtd"> <!-- SPDX-License-Identifier: MIT --> <fontconfig> <group> <target>@canonical_family_name@</target> </group> </fontconfig>
group element SHOULD include all the configuration elements for the font family, named
@canonical_family_name@ (the objective to assemble).
It MUST contain a single
target child specifying this
At the end of the processing, all the font files that match the top-level
@canonical_family_name@ at scan time:
- should have their
- except for the
Regularstyle, which is omitted from
- except for the meta no-style variable font
fullname, which requires special handling
- except for the
group SHOULD support the usual configuration merging mecanism :
- when only one value for a setting is possible, the first parsed
groupthat contains this setting for a given font family, wins
- when several values are possible (ie substitution lists) the lists are assembled with the elements parsed first as higher priority in the list
A similar result was obtained in the past with multiple uses of the following pattern.
However, this pattern requires identifying beforehand all the styles present in the technical font families. Therefore, it is not robust against font changes.
Also, the human must remember the
Regular and variable special cases.
Even with a motivated human, the number of declaration blocks required to list all the styles present in the font files limits its scaling to simple font families.
<match target="scan"> <test name="family"> <string>@canonical_family_name@</string> </test> <test name="style"> <string>@original_style_name@</string> </test> <edit name="fullname"> <string>@canonical_family_name@ @original_style_name@</string> </edit> </match>
Minimal real-world exemple
<?xml version="1.0"?> <!DOCTYPE fontconfig SYSTEM "fonts.dtd"> <!-- SPDX-License-Identifier: MIT --> <fontconfig> <group> <!-- ADF confuses Name ID 6 construction rules with Name ID 4 rules --> <target>Accanthis ADF Std No2</target> </group> </fontconfig>