7

Devanagari fonts appear broken like this:

It should appear this way

I have the same problem in browsers and office applications.

Is there any way to fix it?

8
  • Can you include a screen shot? I don't see a broken seeming font (not viewing from an Ubuntu browser at present).
    – Zeiss Ikon
    Dec 1, 2016 at 12:49
  • I think he mistakenly wrote 6.0 LTS instead of 16.04 LTS.
    – Ryko
    Dec 1, 2016 at 12:57
  • 1
    Is there more than one Devanagari font available you can test with? For instance, like Times New Roman versus Baskerville/Baskervald for English? That would eliminate the specific font file itself as the source of the problem.
    – Zeiss Ikon
    Dec 1, 2016 at 13:44
  • 1
    The "correct" image helps, but it would help to also have a screen capture of the "broken" font as it appears on your screen.
    – Zeiss Ikon
    Dec 1, 2016 at 15:16
  • 1
    Related question and answer
    – user68186
    Oct 6, 2018 at 14:46

4 Answers 4

11
+100

Install the fonts-deva package, if you haven't already done so. Then create the file ~/.config/fontconfig/conf.d/10-prefer-devanagari.conf with the following contents:

<?xml version="1.0"?>
<!DOCTYPE fontconfig SYSTEM "fonts.dtd">
<fontconfig>
        <alias>
                <family>serif</family>
                <prefer>
                        <family>Lohit Devanagari</family>
                </prefer>
        </alias>
        <alias>
                <family>sans-serif</family>
                <prefer>
                        <family>Lohit Devanagari</family>
                </prefer>
        </alias>
        <alias>
                <family>monospace</family>
                <prefer>
                        <family>Lohit Devanagari</family>
                </prefer>
        </alias>
</fontconfig>
5
  • i tried both but i didn't get fixed. command yielded a lot of this bash: syntax error near unexpected token `newline' Dec 2, 2016 at 4:24
  • @PratikGautam: Then you misunderstood the above somehow or made a typo. Dec 2, 2016 at 14:08
  • says no such file or directory. can not find fontconfig
    – Ekoji
    Jan 10, 2018 at 14:12
  • @Ekoji: You may need to create the directory: mkdir -p ~/.config/fontconfig/conf.d Jan 10, 2018 at 15:02
  • Worked for me. Many many thanks @GunnarHjalmarsson
    – Lokesh
    Jun 18, 2020 at 7:32
2

Download Google Noto Fonts (choose Noto Sans Devanagari) and add it to Home > .fonts

If .fonts folder is not available in Home folder create it.

.fonts folder will be hidden by default. Use CTRLH to see hidden files and folders before creating a .fonts folder.

You can use other Google Noto Fonts for any Indic language you would like to use.

If you want to have different font weights, choose fonts with those qualities.

This is just one simple way of doing it. There could be a thousand other ways to use Devanagari fonts in Ubuntu.

1
  • 1
    It should be mentioned that Noto Sans Devanagari is available in the Ubuntu archive via the fonts-noto-hinted package. Dec 2, 2016 at 14:15
0

Just Go to Settings of Browser And Select Gargi Font from Drop Down.

For Firefox :

  1. Go to From Menu preferences.

  2. Under Language & Appearance Default Font Set it To Gargi.

  3. Click On Advance Tab Next To Default Font Settings.

  4. Then Set Fonts For "Devnagari" from Drop Down.

  5. Set Serif San-serif & Monospace to Gargi.

You Can Instantly Check using Google Typing Tool Online.

For Chrome:

  1. Settings->Appearance Set All Fonts Value to Gargi From Drop Down Menu.

  2. Then From Advanced Tab Install Extension For "Advanced Font Settings"

  3. In Than Set All Fonts to Gargi.

0

This is happening because of fonts.

To render any language text, font should support that text. Default fonts of Ubuntu does not render Devanagari correctly.

In order to correctly show devanagari text, we need a font which is fully supporting devanagari.

To setup the correct font we need to do following steps.

  1. Download Noto Sans Devanagari. This package contains many fonts.
  2. Open Home folder and check for hidden files. You can use Ctrl + H for the same.
  3. If you cannot find .font folder, create one. Extract downloaded zip file into this folder. This step will integrate all these fonts into Ubuntu. So technically you can use any of these fonts in any of the software.
  4. Open settings of chrome. Search for font. Click on Customize Fonts.
  5. Change Standard Font to Lohit Devanagari or any other font which renders devanagari correctly.

To render devanagari correctly in any other software, we can do the same by selecting font as Lohit Devanagari.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .