Devanagari (combined) words are not displaying correctly

fontsprintingtrisquelunicode

I use Trisquel 7.0 LTS with GNOME 3 Flashback installed.

Combined devanagari fonts like: श्री is not displaying (and hence printing) correctly.

Example- The latter should be displayed as follows:

  1. enter image description here
  2. enter image description here

But currently displaying as follows:

  1. enter image description here
  2. enter image description here

So, how do I fix it?

I am facing this problem in every text fields such as: text-editor, LibreOffice, web-browser etc except with pdf.

Rarely it displays correctly in web-page but when I copy and paste it to gedit or libreoffice, facing mentioned problem.

Ask me if any information required to be provided with question in order to analyse and fix this issue.

Best Answer

The solution is to install appropriate font package to the system which is ttf-devanagari-fonts here. (You can search on repository).

ttf-devanagari-fonts - Free TrueType fonts for languages using the Devanagari script

Package Description:

Description: Free TrueType fonts for languages using the Devanagari script Fonts for languages that use the Devanagari script in writing. This package has fonts for Hindi, Kashmiri, Konkani, Marathi, Maithili, Nepali, Sanskrit, and Sindhi languages.

So, sudo apt-get install ttf-devanagari-fonts installs the devanagari fonts:

$ ls /usr/share/fonts/truetype/ttf-devanagari-fonts/
chandas1-2.ttf  lohit_kok.ttf  lohit_mai.ttf  lohit_ne.ttf  nakula.ttf    samanata.ttf           Sarai_07.ttf
kalimati.ttf    lohit_ks.ttf   lohit_mr.ttf   lohit_sd.ttf  sahadeva.ttf  Samyak-Devanagari.ttf

Now, Devanagari fonts are displaying correctly.


Update: For the latest current (LTS) version of Trisquel GNU Linux i.e 8.0 Flidas, install the following package:

$ apt-cache search fonts-deva
fonts-deva - Meta package to install all Devanagari fonts
fonts-deva-extra - Free fonts for Devanagari script

And then set Lohit Devanagari by creating following configuration file as described here:

$ cat .config/fontconfig/conf.d/10-prefer-devanagari.conf 
<?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>

Logout and re-login to get the effect.

Related Question