Issue with Arabic Type

Hi all,
Trying to display Arabic text and I’m not getting the correct letter forms (initial, medial and final).
All it displays is the “detached” form of the letters.

I have added the unicode ranges that I thought would take care of them (ArabicPresFormsA & B), but it still isn’t working.
Here’s a snippet:

ofTrueTypeFontSettings settings("DubaiRegular.ttf", 155);
    settings.addRange(ofUnicode::Arabic);
    settings.addRange(ofUnicode::ArabicPresFormsA);
    settings.addRange(ofUnicode::ArabicPresFormsB);
    
    ttf.load(settings);
    s = "دبي";

The text should look like what I initialized the above string (s), however it ends up looking like this (detached form only):

Anybody have an idea, or experience with Arabic type?

Thanks in advance,
O

For the record, the same thing happens if I use ofAlphabet::Arabic.

yes we don’t have shaping support yet. someone reported a while ago that you can use some tools, a python script, that allows you to join the characters and the you can use that output to display it correctly in OF: here’s the post with the details: Change draw direction from ltr to rtl

1 Like

this is an online tool that should give you reshaped text that should work on OF http://pydj.mpcabd.xyz/arabic-reshaper/

1 Like

Ah perfect, thanks a lot @arturo ! Useful thread. Will check it out now.

Online tool does the trick!
Thanks again.

1 Like