You are not logged in.

#1 2018-01-09 13:17:30

abdulhakeem
Member
From: Chicagoland
Registered: 2016-07-31
Posts: 39
Website

[GNOME] How to Set Default Font for Arabic?

I primarily use English and I know how to change default English fonts in Gnome Tweaks. However I also read and type and Arabic from time to time, and I'm trying to find a way to choose the default font for Arabic text, as I really don't like the default Arabic font that is used, but I'm not sure how to change it. Gnome Tweaks only lists options for English.

I'd like to be able to set the default font for all Arabic text to Noto Naskh Arabic

Does anyone know of a way to do this? Do I need to generate a new locale or something? I think I only generated en_US at installation


And the worldly life is not but amusement and diversion; but the home of the Hereafter is best for those who fear Allah, so will you not reason? {6:32}

Offline

#2 2018-01-09 13:26:14

exad
Member
Registered: 2016-11-15
Posts: 33

Re: [GNOME] How to Set Default Font for Arabic?

Hmm, I found this thread that might be helpful to you.

https://bbs.archlinux.org/viewtopic.php?id=9663

Sorry I don't have much experience with arabic fonts

Offline

#3 2018-01-09 14:59:59

seth
Member
Registered: 2012-09-03
Posts: 65,346

Re: [GNOME] How to Set Default Font for Arabic?

Not. At least not the way I imagine what you want.
Iffff your preferred arabic font doesn't contain latin letters or your preferred latin font doesn't contain arabic ones, you can configure fontconfig to use one as fallback for the other. Otherwise this isn't going to work (font selection by utf-8 range is afaiu not possible)

DISPLAY=:0 FC_DEBUG=4 pango-view --font="Noto Naskh Arabic" -t "a" | grep family
DISPLAY=:0 FC_DEBUG=4 pango-view --font="Source Sans" -t "ب" | grep family

Notice that the font names used above have to be accurate, grep for the font name in fc-list

Online

#4 2018-01-10 18:46:03

haricot
Member
Registered: 2017-12-09
Posts: 7

Re: [GNOME] How to Set Default Font for Arabic?

If you have gnome tweaks already installed you may edit the css file: sudo nano /usr/share-gnome-shell/theme/gnome-shell.css.
if you scroll down to font-family you can replace the offered fonts with your choice. Download  the ttf font noto nashk arabic from its website arabicfont.net and install it in /usr/share /fonts.
This may help you but there's no quarantee. If you run into trouble doing this there is plenty of gnome experts to assist you

Offline

#5 2018-01-10 20:25:29

ooo
Member
Registered: 2013-04-10
Posts: 1,638

Re: [GNOME] How to Set Default Font for Arabic?

I don't think there's any way to do this via GUI, but you can set fallback fonts with fontconfig as seth suggested. There's a configuration example for japanese fonts in wiki: https://wiki.archlinux.org/index.php/Fo … s#Japanese


@haricot,
It's great that you're trying to help, but you should at least have some idea what you're talking about.

First, you're describing how to switch the font for gnome-shell theme, which has nothing to do with the issue in first post. Second, there haven't been /usr/share-gnome-shell/theme/gnome-shell.css since gnome 3.12 or so.
Third, I don't know who the "gnome experts" you are talking about are, but if you're going to (mis)guide people, you should at least be prepared to assist with your own instructions, and not leave that to others.

Offline

#6 2018-01-12 20:13:15

abdulhakeem
Member
From: Chicagoland
Registered: 2016-07-31
Posts: 39
Website

Re: [GNOME] How to Set Default Font for Arabic?

Thanks for the responses everyone. I might have to try tweaking fontconfig as a few have suggested. Will update if I can get it to work


And the worldly life is not but amusement and diversion; but the home of the Hereafter is best for those who fear Allah, so will you not reason? {6:32}

Offline

#7 2018-05-07 02:17:23

darmanto
Member
Registered: 2018-05-07
Posts: 1

Re: [GNOME] How to Set Default Font for Arabic?

Hi @abdulhakeem, did you get it working for you? could you please share, as I'm also having same problem. Syukron.

Offline

#8 2020-08-01 19:30:50

shakram02
Member
Registered: 2020-08-01
Posts: 1

Re: [GNOME] How to Set Default Font for Arabic?

Hello, I had the same problem and I managed to overcome it by modifying

/etc/fonts/conf.d/40-nonlatin.conf

If it doesn't exist, try:

/etc/fonts/fonts.conf

edit font names for each family (serif, sans serif and cursive). My main problem was the cursive font family.

Offline

#9 2020-08-01 20:46:36

abdulhakeem
Member
From: Chicagoland
Registered: 2016-07-31
Posts: 39
Website

Re: [GNOME] How to Set Default Font for Arabic?

@darmanto no I gave up on trying, but I did find a browser extension that helps with Arabic font rendering in Chrome and Firefox:

https://chrome.google.com/webstore/deta … jfhn?hl=en

https://addons.mozilla.org/en-US/firefo … src=search



@shakram02 thanks I will try that


And the worldly life is not but amusement and diversion; but the home of the Hereafter is best for those who fear Allah, so will you not reason? {6:32}

Offline

#10 2025-01-20 13:55:01

Elemb3awi
Member
Registered: 2025-01-20
Posts: 1

Re: [GNOME] How to Set Default Font for Arabic?

this is the only solution that fixed my problem
Install fontconfig is  (if it's not already)

1- Download the font you want.
- Extract it if it's compressed.
- Open the terminal.
- Navigate to the location of the font, usually: cd Downloads.
2- sudo cp the font to this path: /usr/share/fonts/truetype.
3- In the terminal, type: sudo fc-cache -fv (This is to make the system recognize the new fonts.)
4- You need to modify the fonts configuration by creating another custom one named local.conf at this path. To simplify, open the terminal and type: sudo nano /etc/fonts/local.conf.
5- Paste this content inside the file:
<?xml version="1.0" encoding="UTF-8"?>
<fontconfig>

  <!-- English Font Configuration-->
  <match target="pattern">
    <test name="family">
      <string>sans-serif</string>
    </test>
    <edit name="family" mode="prepend">
      <string>YOUR DESIRED ENGLISH FONT</string>
    </edit>
  </match>

  <!-- Other Language Font Configuration -->
  <match target="pattern">
    <test name="lang">
      <string>XY</string>
    </test>
    <edit name="family" mode="assign">
      <string>YOUR DESIRED FONT</string>
    </edit>
  </match>

</fontconfig>
every language has a two~three letters thing idk what its called but Arabic is ar, English is en, So find your language's letters and replace it instead of XY in the file above
6- Replace YOUR DESIRED FONT with your font's name.
(Note: If the font name is something like SF-Pro-Display-Regular.ttf, write it in the file without the - , like SF Pro Display, and don't forget the capital letters,  If there are no spaces, like NotoSans-Regular.ttf, write it as Noto Sans with the first letters capitalized. and don't type -Regular )
(If you don't need to change the English font, delete the section from <fontconfig> at the top to the Language Font Configuration part.)
7- Inside the terminal, press Ctrl + X, then press Y to save the file.
8- Reboot.
LAST OPTION
if that didn't work,
permanently delete your other language default system font.
and this is really the last option like if it didn't work just give up cuz noway !!
in /etc/fonts/conf.d/
open each file and search for your language mentioned in it and you will see either a default font given to it or preferred font on top and fallback fonts after it, what you're gonna do is that you'll  replace the font attached to your language with your desired font and make it the first one on top in the fallbacks case.
I hope this helps anybody

Offline

#11 2025-01-21 16:52:53

seth
Member
Registered: 2012-09-03
Posts: 65,346

Re: [GNOME] How to Set Default Font for Arabic?

Please use [code][/code] tags. Edit your post in this regard.

How does that differ from https://wiki.archlinux.org/title/Font_c … les#Arabic ?

Online

Board footer

Powered by FluxBB