Skip to content

Instantly share code, notes, and snippets.

@siddhpant
Created June 11, 2022 10:20
Show Gist options
  • Save siddhpant/8de5df38b437372d0e9fd80b9332e7a0 to your computer and use it in GitHub Desktop.
Save siddhpant/8de5df38b437372d0e9fd80b9332e7a0 to your computer and use it in GitHub Desktop.
Change the Devanagari font on Linux
<?xml version="1.0"?>
<!DOCTYPE fontconfig SYSTEM "fonts.dtd">
<fontconfig>
<!-- Set Mukta as the Devanagari font. -->
<!-- We will remove Devanagari characters from all fonts except Mukta. -->
<!-- Idea courtesy: https://stackoverflow.com/a/47614324 -->
<!-- Pseudo code: -->
<!-- for font in fonts: -->
<!-- if "Mukta" not in font.family -->
<!-- font.charset = charset.all - charset.devanagari -->
<match target="scan">
<test qual="any" name="family" compare="not_eq">
<string>Mukta</string>
</test>
<edit name="charset" mode="assign"> <!-- Edit the charset. -->
<minus> <!-- Remove chars from charset. -->
<name>charset</name>
<charset>
<range>
<!-- Devanagari (Normal) -->
<int>0x0900</int>
<int>0x097F</int>
</range>
<range>
<!-- Devanagari Extended -->
<int>0xA8E0</int>
<int>0xA8FF</int>
</range>
</charset>
</minus>
</edit>
</match>
</fontconfig>
@siddhpant
Copy link
Author

Change Mukta to any font you like.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment