Score:0

Devanagari fonts not rendering properly on 20.04 systemwide

na flag

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?

Gunnar Hjalmarsson avatar
uz flag
Is LibreOffice installed as a .deb file or a snap?
Adnan avatar
na flag
It's installed as a flatpak.
Gunnar Hjalmarsson avatar
uz flag
I see. If I was you I'd uninstall the flatpak, install the `libreoffice` .deb package, and see if it makes a difference.
Adnan avatar
na flag
The deb package is working as I wanted. What's going on? What's wrong with flatpak version?
Gunnar Hjalmarsson avatar
uz flag
Don't know, sorry. I know nothing about flatpak. If you really want to know, I'd suggest that you submit a new question about that specifically.
Score:0
na flag

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>
    
        <alias>
            <family>sans-serif</family>
                <prefer>
                    <family>Ubuntu</family>
                    <family>Noto Sans Devanagari</family>
                    <family>Lohit Devanagari</family>
                    <family>Mukta</family>
                    <family>Arial Unicode MS</family>
                </prefer>
        </alias>
    
        <alias>
            <family>serif</family>
                <prefer>
                    <family>Noto Serif</family>
                    <family>DejaVu Serif</family>
                    <family>Liberation Serif</family>
                    <family>Noto Serif Devanagari</family>
                    <family>Lohit Devanagari</family>
                    <family>Arial Unicode MS</family>
                </prefer>
        </alias>
    
        <alias>
            <family>monospace</family>
                <prefer>
                    <family>Ubuntu mono</family>
                    <family>Noto Sans Mono</family>
                    <family>DejaVu Sans Mono</family>
                    <family>Liberation Mono</family>
                    <family>Noto Sans Devanagari</family>
                    <family>Lohit Devanagari</family>
                    <family>Arial Unicode MS</family>
                </prefer>
        </alias>
    </fontconfig>
mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.