You are not logged in.

#1 2024-07-26 12:55:23

kiskiller0
Member
Registered: 2023-01-23
Posts: 6

programs don't respect my .fonts.conf file, except for firefox

file: .fonts.conf

<?xml version="1.0"?>
<!DOCTYPE fontconfig SYSTEM "fonts.dtd">
<fontconfig>
    <match target="pattern">
        <test name="lang" compare="contains">
            <string>ar</string>
        </test>
        <test qual="any" name="family">
            <string>sans-serif</string>
        </test>
        <edit name="family" mode="prepend" binding="strong">
            <string>Amiri</string>
        </edit>
    </match>

    <match target="pattern">
        <test name="lang" compare="contains">
            <string>ar</string>
        </test>
        <test qual="any" name="family">
            <string>serif</string>
        </test>
        <edit name="family" mode="prepend" binding="strong">
            <string>Amiri</string>
        </edit>
    </match>
</fontconfig>

notes:
- the file is not physically in the home directory, but it is a soft link
- the fonts that are specified in .fonts.conf are installed in ~/.local/share/fonts, and not globally

behavior:
- system apps (nautilus), 3d party apps (vscode), and browsers seem to use a globally installed font to render arabic text, with the exception of firefox, which follows the .fonts.conf rules

expected behavior:
- all apps using the 'Amiri' font for arabic text as per the rules specified in .fonts.conf

relevant details:
- archlinux with gnome
- apps are installed through pacman, and not flathub, so they pretty much can access config files in the home directory

Last edited by kiskiller0 (2024-07-26 12:59:38)

Offline

#2 2024-07-26 18:36:40

seth
Member
Registered: 2012-09-03
Posts: 57,455

Re: programs don't respect my .fonts.conf file, except for firefox

https://wiki.archlinux.org/title/Font_c … les#Arabic

The above should work for most applications but some applications like Chromium do not work with the language match test. If you find some applications not using your selected fonts, you can use the below alias and prefer tags which seems to work.

locale

Offline

Board footer

Powered by FluxBB