You are not logged in.
Some websites in Firefox on Arch Linux do not render the devanagari fonts correctly. Particularly, the glyph known as "Shri" in Sanskrit language is not rendered correctly on Arch. On the first line of this wikipedia page the glyph Shri is rendered incorrectly as this.. However, the same glyph "Shri", on Windows as well as Linux Mint, in the same wiki page is rendered correctly as this. (in Firefox too).
So I'm thinking this is more of an Arch Specific configuration issue. I have all the devnagari fonts installed that were installed in my other Linux Mint computer.
"fc-list | grep -i devanagari | nl" output on Linux Mint:
1 /usr/share/fonts/truetype/noto/NotoSansDevanagari-Bold.ttf: Noto Sans Devanagari:style=Bold
2 /usr/share/fonts/truetype/lohit-devanagari/Lohit-Devanagari.ttf: Lohit Devanagari:style=Regular
3 /usr/share/fonts/truetype/noto/NotoSerifDevanagari-Regular.ttf: Noto Serif Devanagari:style=Regular
4 /usr/share/fonts/truetype/noto/NotoSansDevanagari-Regular.ttf: Noto Sans Devanagari:style=Regular
5 /usr/share/fonts/truetype/samyak/Samyak-Devanagari.ttf: Samyak Devanagari:style=Regular
6 /usr/share/fonts/truetype/noto/NotoSerifDevanagari-Bold.ttf: Noto Serif Devanagari:style=Bold
"fc-list | grep -i devanagari | nl" output on Arch Linux:
1 /home/nikin/.local/share/fonts/NotoSansDevanagari/NotoSansDevanagari-Regular.ttf: Noto Sans Devanagari:style=Regular
2 /home/nikin/.local/share/fonts/Lohit-Devanagari/Lohit-Devanagari.ttf: Lohit Devanagari:style=Regular
3 /home/nikin/.local/share/fonts/NotoSansDevanagari/NotoSansDevanagari-Bold.ttf: Noto Sans Devanagari:style=Bold
4 /home/nikin/.local/share/fonts/NotoSerifDevanagari/NotoSerifDevanagari-Bold.ttf: Noto Serif Devanagari:style=Bold
5 /home/nikin/.local/share/fonts/Samayak-Devanagari/Samyak Devanagari Regular.ttf: Samyak Devanagari:style=Regular
6 /home/nikin/.local/share/fonts/NotoSerifDevanagari/NotoSerifDevanagari-Regular.ttf: Noto Serif Devanagari:style=Regular
The LANG variable on both machines is set to "en_UTF-8". I've also updated the font cache with "fc-cache" and done a reboot. How do I get the glyph to be rendered correctly?
Last edited by nikinbaidarr (2022-11-10 13:29:06)
Offline
Online
Running
FC_DEBUG=4 pango-view --font="sans" -t "श्र" | grep family:
shows the fallback font is "FreeSans".
Testing different fonts I found it was "Lohit Devanagari" that produces the expected results.
So as per Fallback font order I put
<?xml version="1.0"?>
<!DOCTYPE fontconfig SYSTEM "fonts.dtd">
<fontconfig>
<alias>
<family>sans</family>
<prefer>
<family>Lohit Devanagari</family>
</prefer>
</alias>
</fontconfig>
in the file ~/.fontconfig/fonts.conf
And yet system continues to use Freesans for that matter.
The output of
$ fc-match -a sans | less | nl | grep Lohit
20 Lohit-Devanagari.ttf: "Lohit Devanagari" "Regular"
.
Offline
html, body {
font-family: sans-serif;
}
Online
font-family: sans-serif;
Totally forgot about sans-serif. That fixed the original issue with the Wikipedia site amongst others. But if I try to type or copy/paste that letter to something like google docs or overleaf or other local host applications it still gets rendered incorrectly.
Offline
Is there a reason why you keep around https://archlinux.org/packages/extra/an … ree-fonts/ when you don't like it?
It's probably drawn in by /etc/fonts/conf.d/40-nonlatin.conf and/or /etc/fonts/conf.d/69-unifont.conf
Online
Is there a reason why you keep around https://archlinux.org/packages/extra/an … ree-fonts/ when you don't like it?
It's probably drawn in by /etc/fonts/conf.d/40-nonlatin.conf and/or /etc/fonts/conf.d/69-unifont.conf
I can't seem to remove gnu-free-fonts, even as root.
checking dependencies...
error: failed to prepare transaction (could not satisfy dependencies)
:: removing gnu-free-fonts breaks dependency 'ttf-font' required by firefox-developer-edition
:: removing gnu-free-fonts breaks dependency 'ttf-font' required by inkscape
Although I removed the entries from those two files. I could still manually set the font in google docs and libre office but still no luck with other applications such as overleaf amongst others.
Offline
Online
$ pkg-list_providers ttf-font
ttf-font extra/gnu-free-fonts
ttf-font extra/noto-fonts
ttf-font extra/ttf-bitstream-vera
ttf-font extra/ttf-croscore
ttf-font community/ttf-dejavu
ttf-font community/ttf-droid
ttf-font community/ttf-ibm-plex
ttf-font community/ttf-liberation
CLI Paste | How To Ask Questions
Arch Linux | x86_64 | GPT | EFI boot | refind | stub loader | systemd | LVM2 on LUKS
Lenovo x270 | Intel(R) Core(TM) i5-7200U CPU @ 2.50GHz | Intel Wireless 8265/8275 | US keyboard w/ Euro | 512G NVMe INTEL SSDPEKKF512G7L
Offline
Okay so removing free fonts fixed the issue for everything except my terminal. I'm using st and have used the font2 patched and loaded the desired font in there but the glyph doesn't render properly in my terminal window.
Offline
Ftr. https://st.suckless.org/patches/font2/
Please post your st config.h and explain "doesn't render properly" - you're probably trying to use a non-fixed width font?
fc-list :mono | grep -i devanagari
Online
Please post your st config.h
st config.h is around 500 lines long so just posting the part relevant to just fonts:
static char *font = "Source Code Pro Medium:size=10";
static char *font2 = "Noto Sans Devanagari:size=10";
explain "doesn't render properly" - you're probably trying to use a non-fixed width font?
"doesn't render properly" as in what was happening before. The ligature is displayed incorrectly as in the wiki page above. The other devanagari text is rendered properly and correctly.
Furthermore,
fc-list :mono | grep -i devanagari
gives nothing.
Although,
$ FC_DEBUG=4 pango-view --font="mono" -t "श्र" | grep family:
Shows:
family: "Noto Sans Devanagari"(s)
family: "Noto Sans Devanagari"(s)
And produces the renders the shri glyph as expecrted.
Offline
How can it look the same after removing the causing GNU FreeFonts?
FC_DEBUG=4 pango-view --font="Source Code Pro" -t "श्र" | grep family:
Since st by default uses the fontconfig substitution and you're apparently just adding the Devanagari font, how does it behave w/o the patch (now)?
Do other Devanagari *ligatures* render fine?
Online
How can it look the same after removing the causing GNU FreeFonts?
I did indeed remove the GNU free fonts, but there were more fonts installed as dependencies on my system:
pacman -Q | grep -i font | nl
1 adobe-source-code-pro-fonts 2.038ro+1.058it+1.018var-1
2 cantarell-fonts 1:0.303.1-1
3 fontconfig 2:2.14.1-2
4 gsfonts 20200910-2
5 libfontenc 1.1.6-1
6 libxfont2 2.0.6-1
7 noto-fonts 20220810-1
8 xorg-fonts-encodings 1.0.6-1
FC_DEBUG=4 pango-view --font="Source Code Pro" -t "श्र" | grep family:
As well as --font="Source Code Pro Medium" results in expected rendering.
Since st by default uses the fontconfig substitution and you're apparently just adding the Devanagari font, how does it behave w/o the patch (now)?
Same thing with and without the patch. Although I've added this to my fontconfig:
<alias>
<family>monospace</family>
<prefer>
<family>Source Code Pro Medium</family>
</prefer>
</alias>
<alias>
<family>sans-serif</family>
<prefer>
<family>Noto Sans</family>
<family>Noto Sans Devanagari</family>
</prefer>
</alias>
Do other Devanagari *ligatures* render fine?
No they don't. While other devanagari glpyhs render properly, *ligatures* don't. I didn't notice it until you pointed it out. Ligatures are working fine outside st.
Offline
You know what. It's not worth bothering about that font in the terminal. I don't even use it there so be it. I wanted it to render properly in browsers and other web applications which it is now.
I cannot thank you enough for your time. Thank you so much! I'll mark this thread as solved and also change the title to something more general so others can find it if they're having similar issues.
Thanks agian!
Offline