Right-to-Left (RTL) Languages Support

I remember back in the year 2000 when people were looking up to BeOS as an alternative to the M$. It’s really nice to see that OS alive in Haiku.

I still have not installed Haiku, because I don’t have an x86-64 system in hand and it’s somehow difficult to emulate x86 on my M2 Mac. But I’m planning to get a decent iCore computer and install Haiku on it soon.

Meanwhile, I’d like to know if Haiku supports right-to-left (RTL) languages, such as Arabic, Hebrew, Farsi, Urdu, etc.? And if it’s not possible yet to type in these langue’s inside the OS’ apps, then does its Falcon web browser display pages in these languages?

Thanks!

Welcome Fargo!

I don’t think there has been work on RTL lately (or at all?). There was interest by a student for this year’s GSoC, but wasn’t entered as proposal I think.

I expect I won’t recognize how accurate browsers in Haiku render RTL sites… :slight_smile:
I never had a Mac and don’t know how well that works, but you could try using Parallels to virtualize Haiku and have a look-see.

[I think the “International” category doesn’t make it to the regular forum front page. It’s meant for non-English content. I’ve re-categorized this thread to give it more visibility.]

1 Like

Use UTM. Reasonably cheap at the Apple Appstore or free from Github. It is a QEMU frontend and I have 4 x86_64 VMs with Haiku on my M2 Mac Mini that I use to make all my videos. I can share a VM with you to get you started, just PM me.

1 Like

Parallels is a virtualiser and on Apple Silicon can only run ARM64 operating systems.
QEMU is the only option to emulate a different architecture.

1 Like

UTM uses QEMU.

Sure, I’m aware of that but UTM is just GUI and it’s not strictly required. Frankly speaking, I don’t even use it

From the user point of view, QEMU is not the only option, even if UTM actually uses it in the backend.

Thank you guys for all the info. I installed Beta 5 using UTM emulator.

From CharacterMap app, it seems Haiku supports Unicode and hence supports RTL languages as well. The CharacterMap shows little rectangles for Arabic and Hebrew characters for example. Also, when visiting a multilingual website, RTL text appears as rectangles as in the attached screenshot.

IMO, the first step in supporting RTL is to use a system font containing all RTL languages characters (glyphs/shapes). Then, integrate one of the available libraries to do text BiDi and shaping for RTL, such as FriBidi.

For the font issue, you could try installing “Noto regional” from HaikuDepot and see how far that gets you at least in the browser.

1 Like

Noto regional font adds almost all RTL languages characters into the system.

After changing the “Appearance” font to Noto Sans Arabic, Windows’ title bars show Arabic characters, but in wrong direction and shape. BiDi (reverse the text flow from right to left) and shaping (choosing the correct character shape based on its location) are needed. This can be implemented using available open source libraries as mentioned above.

WebPositive partially renders Arabic webpages now; it does BiDi but lacks shaping.

Falkon on the other hand renders Arabic perfectly! Even tabs’ titles appear correctly. This screenshot shows how a Flacon’s tab displays perfect Arabic text with BiDi and shaping, while the system’s bar above it does not even though both display the same text.

Screenshot 2024-09-16 at 9.02.45 PM

Currently we lack support for the font shaping required in our application server (the component that does the actual drawing).

This is supposed to be fixed by including harfbuzz and having it do that, but nobody did that yet.

Arabic is also missing in the font fallback table.

Anyhow, using a unicode compatible encoding sadly does not mean that we support every language, there is a lot of work to be done for it.

I hope developers will have the time soon to integrate HurfBuzz into the this excellent project.

The RTL support is almost there! I installed AbiWord and it has all the RTL features available in other systems.

I couldn’t properly enter text in AbiWord because the Arabic keyboard layout in the Keymap app is wrong. I tried to fix it by clearing the bottom keyboard row, but couldn’t figure out how to assign the correct letters to the keys.

1 Like

If you do it from the GUI, you can drag and drop characters from CharacterMap.

It may be easier to edit the source file and enter the unicode keycodes manually.

Only in ported applications that don’t use app_server native code, and do the font rendering on their own side. So, it will work in Qt and GTK applications, but not in Haiku ones.

2 Likes

See the User Guide’s Keymap for more info.

1 Like

Thank you. I may report a bug/enhancement regarding Arabic keyboard layouts. There are two common layouts; one for IBM/MS and the other is for Apple computers. I think Haiku should support both layouts like other current OSs.

I don’t think there’s anyone knowledgeable about RTL writing systems among the development team at the moment. So if you want to see the Arabic keyboard layouts fixed, it may be most efficient if you contributed them yourself :slight_smile:

1 Like

I agree with waddlesplash. Integrating harfbuzz is probably doable but checking if the rendering is correct is really difficult if you don’t know the characters, and latin derives alphabets usually only have very limited ligatures to test.

I’d love to help, but unfortunately I lack the technical knowledge and can’t write code. I can help though by submitting files for Arabic keyboard layouts (as mentioned here) and by doing tests and reports.

1 Like