Arabic/Persian/Urdu font readability fix.

xfce
fonts
reading
arabic
#1

For anyone having difficulty reading Arabic/Urdu/Persian font as the default font installed in Manjaro is for calligraphy purposes, not for readability.
Here's how it looks before the fix:

To fix this. Here are the steps.

  1. Installed ttf-x2 or your prefered Persian font pack from pacman.
  2. Right-click on desktop, open Thunar Root, Enter Password.
  3. Go to /usr/share/fonts/noto/
  4. Cut every font file that has the text "Arabic", "Urdu", "Nastaliq" in its filename.
  5. Paste them somewhere in a folder on desktop as a backup.
  6. Open your browser and check whether it's fixed.
  7. If the readability is OK, delete that backup folder.

Result: https://imgur.com/a/TUAzJtC

#2

No need to delete fonts, just create following font config /etc/fonts/conf.d/90-noto-urdu.conf and then run fc-cache, restart your browser.

<fontconfig>
    <match target="pattern">
        <test name="lang" compare="contains">
            <string>ur</string>
        </test>
        <test qual="any" name="family">
            <string>sans-serif</string>
        </test>
        <edit name="family" mode="prepend" binding="strong">
            <string>Noto Naskh Arabic UI</string>
        </edit>
    </match>
    <match target="pattern">
        <test name="lang" compare="contains">
            <string>ur</string>
        </test>
        <test qual="any" name="family">
            <string>serif</string>
        </test>
        <edit name="family" mode="prepend" binding="strong">
            <string>Noto Naskh Arabic UI</string>
        </edit>
    </match>
</fontconfig>