Created
April 23, 2025 08:10
-
-
Save isDipesh/9e826b68624fef2ba8db6708ae52cdb8 to your computer and use it in GitHub Desktop.
Setup Devanagari Fonts on (Arch) Linux
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
set -e | |
echo "π¦ Installing recommended Devanagari fonts..." | |
sudo pacman -S --needed noto-fonts noto-fonts-cjk noto-fonts-extra --noconfirm | |
echo "π Creating Fontconfig override for Hindi and Nepali..." | |
mkdir -p ~/.config/fontconfig | |
cat > ~/.config/fontconfig/fonts.conf <<EOF | |
<?xml version="1.0"?> | |
<!DOCTYPE fontconfig SYSTEM "fonts.dtd"> | |
<fontconfig> | |
<match> | |
<test name="lang" compare="contains"> | |
<string>hi</string> | |
</test> | |
<edit name="family" mode="prepend"> | |
<string>Noto Sans Devanagari</string> | |
<string>Lohit Devanagari</string> | |
</edit> | |
</match> | |
<match> | |
<test name="lang" compare="contains"> | |
<string>ne</string> | |
</test> | |
<edit name="family" mode="prepend"> | |
<string>Noto Sans Devanagari</string> | |
<string>Lohit Devanagari</string> | |
</edit> | |
</match> | |
</fontconfig> | |
EOF | |
echo "π Rebuilding font cache..." | |
fc-cache -fv | |
echo "β Done! Verifying..." | |
echo "Hindi font: $(fc-match :lang=hi)" | |
echo "Nepali font: $(fc-match :lang=ne)" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment