0

Fonts are being rendered properly on browsers. The actual problem is Libreoffice Calc where devanagari fonts aren't being rendered properly:

Libreoffice Calc

Here you can see even if the cell properly converts the "Halant", the formula bar doesn't. The only workaround for now is to set default interface font in tweaks to other unicode font such as Arial Unicode MS. But I don't want Arial as my system font. Is there any way to assign Lohit Devanagari or other hindi font the primary font wherever hindi language is used? I've already done what this suggests to no avail.

Edit: on running fc-list :lang=hi family i can see FreeSans and FreeSerif being listed as hindi fonts, of which FreeSans typed hindi looks exactly like what the formula bar on Calc looks like. Is there a way to set other font in Libreoffice instead of FreeSans?

Adnan
  • 1,252

1 Answers1

0

Seems like flatpak apps don't seem to pick up fontconfig files, so replacing them with native deb packages will sort out the problem. However, oftentimes on new installations the font order mess up, so I made a conf file which makes specified font (Lohit Devanagari in this case) default for Hindi, and also puts some fallback fonts for your system when you don't want Lohit Devanagari to become default font for English SSA subtitles:

mkdir -p /.config/fontconfig/conf.d/ && gedit /.config/fontconfig/conf.d/10-hindi.conf

and paste the following:

    <?xml version="1.0"?>
    <!DOCTYPE fontconfig SYSTEM "fonts.dtd">
    <fontconfig>
        <match>
            <test compare="contains" name="lang">
                <string>hi</string>
            </test>
            <edit mode="prepend" name="family">
                <string>Lohit Devanagari</string>
            </edit>
        </match>
    &lt;alias&gt;
        &lt;family&gt;sans-serif&lt;/family&gt;
            &lt;prefer&gt;
                &lt;family&gt;Ubuntu&lt;/family&gt;
                &lt;family&gt;Noto Sans Devanagari&lt;/family&gt;
                &lt;family&gt;Lohit Devanagari&lt;/family&gt;
                &lt;family&gt;Mukta&lt;/family&gt;
                &lt;family&gt;Arial Unicode MS&lt;/family&gt;
            &lt;/prefer&gt;
    &lt;/alias&gt;

    &lt;alias&gt;
        &lt;family&gt;serif&lt;/family&gt;
            &lt;prefer&gt;
                &lt;family&gt;Noto Serif&lt;/family&gt;
                &lt;family&gt;DejaVu Serif&lt;/family&gt;
                &lt;family&gt;Liberation Serif&lt;/family&gt;
                &lt;family&gt;Noto Serif Devanagari&lt;/family&gt;
                &lt;family&gt;Lohit Devanagari&lt;/family&gt;
                &lt;family&gt;Arial Unicode MS&lt;/family&gt;
            &lt;/prefer&gt;
    &lt;/alias&gt;

    &lt;alias&gt;
        &lt;family&gt;monospace&lt;/family&gt;
            &lt;prefer&gt;
                &lt;family&gt;Ubuntu mono&lt;/family&gt;
                &lt;family&gt;Noto Sans Mono&lt;/family&gt;
                &lt;family&gt;DejaVu Sans Mono&lt;/family&gt;
                &lt;family&gt;Liberation Mono&lt;/family&gt;
                &lt;family&gt;Noto Sans Devanagari&lt;/family&gt;
                &lt;family&gt;Lohit Devanagari&lt;/family&gt;
                &lt;family&gt;Arial Unicode MS&lt;/family&gt;
            &lt;/prefer&gt;
    &lt;/alias&gt;
&lt;/fontconfig&gt;

Adnan
  • 1,252