Re: Please clarify matching rules

Lawrence D'Oliveiro <[email protected]>
Newsgroups gmane.comp.fonts.fontconfig
Organization Geek Central
Message-ID <[email protected]>
On Sun, 16 Jul 2017 16:36:40 +0100, Colin Caine wrote:

> I would like `fc-match monospace` to give "Noto Mono". I currently
> only have Noto {Mono,Sans,Serif} and some pixel fonts installed. So
> I'm expecting `fc-match monospace` to receive "Noto Mono" or one of
> the pixel fonts. But what I actually get is "Noto Sans".
> 
> So I add:
> 
> 
>     <alias>
>       <family>Noto Mono</family>
>       <default>
>         <family>monospace</family>
>       </default>
>     </alias>
> 
> 
> But I still get Sans.

First of all, the <family> directives are the wrong way round: the
first one should contain the generic “monospace”, the second one the
specific “Noto Mono” you want to match.

Secondly, <default> places the font at the end of the match list. You
need <prefer> if you want it to go on the front.

Here’s what I tried putting in my own ~/.config/fontconfig/fonts.conf:

    <?xml version='1.0'?>
    <!DOCTYPE fontconfig SYSTEM 'fonts.dtd'>
    <fontconfig>
        <alias>
            <family>monospace</family>
            <prefer>
                <family>Noto Mono</family>
            </prefer>
        </alias>
    </fontconfig>

Here’s what I got before doing the above:

    ldo@theon:~> fc-match monospace file family
    DejaVu Sans Mono:file=/usr/share/fonts/truetype/dejavu/DejaVuSansMono.ttf

and here’s what I got after:

    ldo@theon:~> fc-match monospace file family
    Noto Mono:file=/usr/share/fonts/truetype/noto/NotoMono-Regular.ttf

_______________________________________________
Fontconfig mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/fontconfig
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.