Score:2

How to install one Arabic font for serif and another Arabic font for sans-serif on Ubuntu 22.10?

th flag

I want Ubuntu 22.10 to display serif Arabic text in the Noto Naskh Arabic typeface while sans-serif Arabic text in the Noto Sans Arabic typeface.

Specimen of Noto Naskh Arabic.

Specimen of Noto Sans Arabic.

How can I make Ubuntu install a default Arabic font for serif and another for sans-serif?

I want Ubuntu to follow a rule where, if it sees text whose typeface filename containing words like naskh or serif, it displays all that text in that particular typeface? And if another group of words are have typefaces with filenames containing words like sans or sans-serif, then Ubuntu would show all that text in the default sans-serif Arabic typeface?

Results of fc-match -a | head -10:

NotoSansArabicUI-Regular.ttf: "Noto Sans Arabic UI" "Regular"
NotoSans-Regular.ttf: "Noto Sans" "Regular"
NotoSans-Bold.ttf: "Noto Sans" "Bold"
NotoSans-Italic.ttf: "Noto Sans" "Italic"
NotoSans-BoldItalic.ttf: "Noto Sans" "Bold Italic"
NotoSansArabicUI-Bold.ttf: "Noto Sans Arabic UI" "Bold"
DejaVuSans.ttf: "DejaVu Sans" "Book"
DejaVuSans-Bold.ttf: "DejaVu Sans" "Bold"
NimbusSans-Regular.otf: "Nimbus Sans" "Regular"
NimbusSans-Regular.pfb: "Nimbus Sans" "Regular"

locale:

LANG=en_US.UTF-8
LANGUAGE=
LC_CTYPE=ar_EG.UTF-8
LC_NUMERIC="en_US.UTF-8"
LC_TIME="en_US.UTF-8"
LC_COLLATE="en_US.UTF-8"
LC_MONETARY="en_US.UTF-8"
LC_MESSAGES="en_US.UTF-8"
LC_PAPER="en_US.UTF-8"
LC_NAME="en_US.UTF-8"
LC_ADDRESS="en_US.UTF-8"
LC_TELEPHONE="en_US.UTF-8"
LC_MEASUREMENT="en_US.UTF-8"
LC_IDENTIFICATION="en_US.UTF-8"
LC_ALL=
Score:3
uz flag

Ubuntu's font configuration is prepared for doing just that.

First you need to have these packages installed:

sudo apt install fonts-noto-core fonts-noto-ui-core

Then there are two ways to achieve the desired behavior:

  1. Install the Arabic language via Language Support and select Arabic as your display language.

  2. If you don't want Arabic as the display language, you can generate some Arabic locale and assign it to the LC_CTYPE environment variable:

    sudo locale-gen ar_EG.UTF-8
    sudo update-locale LC_CTYPE=ar_EG.UTF-8
    

(and finally reboot)

facialrecognition avatar
th flag
Thanks for your answer, Gunnar. Do you know what I can do if I've done everything in your answer, but I keep seeing these ugly fonts? Before being forced to switch to Arabic as my display language, I want to give this another chance.
Gunnar Hjalmarsson avatar
uz flag
@facialrecognition: After having done what I suggested, please edit your question and show us the output of these terminal commands: 1. `fc-match -a | head -10` 2. `locale`
facialrecognition avatar
th flag
Good evening, Gunnar. I have just updated my question with the output of the commands in question.
Gunnar Hjalmarsson avatar
uz flag
@facialrecognition: The edits look as expected. Since you have `LC_CTYPE=ar_EG.UTF-8`, fontconfig uses **Noto Sans Arabic UI** at first hand as the Arabic sans font. That should make a difference, and if you don't see that you need to be even more specific about how you reached your conclusion.
facialrecognition avatar
th flag
Hi Gunnar. I think I'm still in this situation because DejaVu is still in use, even if de-prioritized. Do you happen to know how I can remove it *entirely* from my PC? That way, there will not be left any way for it to rear its ugly head again and for any other text to show itself in this font anymore. Thanks!
Gunnar Hjalmarsson avatar
uz flag
@facialrecognition: Removing the `fonts-dejavu-core` package is not an option, since a lot of other packages depend on it. The current setup, where DejaVu is de-prioritized as you put it, is the result of [this long (veeery long) Discourse topic](https://discourse.ubuntu.com/t/request-better-arabic-font-for-ubuntu-20-04/14573). Maybe you want to add a reply there? If you do, it will be seen by a few people with interest and knowledge in the topic.
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.