Skip to content

Instantly share code, notes, and snippets.

@thilinag
Last active December 2, 2022 15:56
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save thilinag/66577033fafd00c3dfdaa898c2478c79 to your computer and use it in GitHub Desktop.
Save thilinag/66577033fafd00c3dfdaa898c2478c79 to your computer and use it in GitHub Desktop.
Change default sinhala font in Ubuntu
  1. Download your favourite sinhala font and add it to /usr/share/fonts/ eg: https://fonts.google.com/noto/specimen/Noto+Sans+Sinhala

  2. Create ~/.config/fontconfig/conf.d/50-custom-si.conf and add below content. (Replace Noto Sans Sinhala with your downloaded font family)

<?xml version="1.0"?>
<!DOCTYPE fontconfig SYSTEM "fonts.dtd">
<fontconfig>
<match target="font">
    <test name="lang" compare="contains">
        <string>si</string>
    </test>
    <alias>
        <family>sans-serif</family>
        <prefer>
            <family>Noto Sans Sinhala</family>
        </prefer>
    </alias>
</match>

<match target="font">
    <test name="lang" compare="contains">
        <string>si</string>
    </test>
    <alias>
        <family>serif</family>
        <prefer>
            <family>Noto Sans Sinhala</family>
        </prefer>
    </alias>
</match>
</fontconfig> 
  1. Re-build font cache by running fc-cache
  2. Can confirm the change by running LANG=si fc-match, you will have to restart most apps to see the change.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment