Comment 14 for bug 2002290

Revision history for this message
M.Hanny Sabbagh (mhsabbagh) wrote :

Hi Egmont.

For bug 1, yes, fontconfig can be used for this. We even have a special configuration file at /etc/fonts/conf.d/56-language-selector-ar.conf to use a different font when the system language is Arabic (Noto Sans Arabic). I believe it can be tweaked to use a custom Monospace font when system language is Arabic like this:

<alias>
  <family>monospace</family>
  <prefer>
   <family>DejaVu Sans Mono</family>
  </prefer>
 </alias>

Adding this to the file made the Monospace font change to DejaVu Sans Mono in some places (e.g Gedit), but the GNOME Terminal was still using Ubuntu Mono for some reason. I don't know why at the moment.

Perhaps I need to open a thread on Ubuntu Discourse. There are some i18n guys there last time I remember. I will do that and see how we can change the default font in the terminal for Arabic.

About lam-alif ligature, if you meant using the letter "alif" + letter "lam" then they can be displayed in a good shape in the terminal. But if you meant this one combined letter which has both alif and lam already together then it is indeed broken in the terminal. However, not so many Arabic people use this letter, and as a workaround, it can be written as a normal lam + normal alif in order to be displayed like the first line in my new attached screenshot. I think it's not a big deal for now.

For bug 2. Wow! Indeed as you said, it works well now and the text is displayed correctly just like in Gedit. I attached a screenshot.

Is there a way where we can use this "printf '\e[?2501h'" workaround in the GNOME Terminal in Ubuntu, at least only when the Arabic language is set for the system by default? If the user is an Arabic-based user, then it makes sense to offer this advantage for him/her in the terminal I believe.

For example, we can append this by default to ~/.bashrc:

systemlanguage=${LANG:0:2}
if [ $systemlanguage == "ar" ]; then printf '\e[?2501h'; fi

If the system language is "ar", it will enable the auto-detection of paragraph direction in the VTE session. What do you think? I can suggest this in the Ubuntu Discourse too for the i18n guys.

Thank you Egmont for your help!