If I have two files in /etc/fonts/conf.d/
.
One being:
<fontconfig>
<alias>
<family>sans-serif</family>
<prefer>
<family>Noto Color Emoji</family>
</prefer>
</alias>
</fontconfig>
And the other one being:
<fontconfig>
<alias>
<family>sans-serif</family>
<prefer>
<family>Noto Emoji</family>
</prefer>
</alias>
</fontconfig>
What would the outcome be after they are both read in?
Reason behind the question --
I have a huge and messy font-selection file. If I can somehow build the font selection from files step by step, that'll be hugely tidy up my messy font-selection file. So,
Using the Noto Emoji as an example, how can I build my font selection step by step so that Noto Color Emoji
is the default and Noto Emoji
is the fallback?
It depends on the number prepending the file name. For instance:
That should give the Color variant higher precedence.
P.S. Have you considered to use the
~/.config/fontconfig/conf.d
directory for the purpose? That way you wouldn't mix your own files with the files installed by various packages.alias
element offontconfig
support a fallback/priority list with default selection. No need for multiple files or alias rules. One alias rules should be enough for single family match.From fontconfig manpage:
Here your example with extended setup:
If you want to force the font bypass matching use
accept
instead.By the way, you may take/think priority of
<prefer>
as medium/prefered,<accept>
as strong/override,<default>
as weak/fallback.Here are a good examples: Beyond Linux® From Scratch (System V Edition) - Overview of Fontconfig