Thread Tools Display Modes
12-23-22, 02:32 PM   #1
Platine
A Cliff Giant
AddOn Author - Click to view addons
Join Date: Dec 2010
Posts: 72
Arabic text display

Hello, in the options of my addon, I would like to display the text in Arabic.
I have the text in the active variable:
active = "قم بتنشيط الوظيفة الإضافية"
And this is correctly typed text, from right to left, saved as UTF-8.
I set it to ipagui.ttf international font.
I get the following text on my in-game screen:

The order of the letters is incorrect. The letters are rearranged, the one at the beginning should be at the end. If I reverse the order of the letters before displaying the text, I get the following text on the screen:

So some of the fonts responsible for connecting the letters are missing.

What font can I use to display the Arabic text correctly?

Last edited by Platine : 12-23-22 at 03:14 PM.
  Reply With Quote
12-23-22, 03:52 PM   #2
Dridzt
A Pyroguard Emberseer
 
Dridzt's Avatar
AddOn Author - Click to view addons
Join Date: Nov 2005
Posts: 1,359
Something like this perhaps? https://fonts.google.com/noto/specim...s+Arabic/about

Also: https://gist.github.com/bmaupin/7cbf...9dc2d391bccbc2
  Reply With Quote
12-29-22, 08:10 AM   #3
Platine
A Cliff Giant
AddOn Author - Click to view addons
Join Date: Dec 2010
Posts: 72
Unfortunately, it didn't help either. Anyway, every typically Arabic font displays it similarly:



I think the Wow engine itself modifies something as it sees the Arabic text.
In order to display it in the form as in the picture above, I have to internally change the order of letters in the text - from the end - even though the text is written correctly, from right to left.
Because displayed directly from the variable, it prints the letters of the text correctly, but in reverse order:



The text stored in the variable is 100% correct in Arabic. Windows displays it like this:



Another problem is the proper positioning of the text in the settings frame.
By default, the text is displayed from left to right and aligned to the left.
SetJustifyH("RIGHT") doesn't work very well.
SetPoint(...) also sets the text from the left, and I need from the right.
Often appear at the end of the text on the right ... instead of displaying all the text.
Are there any other features available to help me?
I use SettingsCheckBoxControlTemplate to create CheckButton.
  Reply With Quote
12-29-22, 12:48 PM   #4
Xrystal
nUI Maintainer
 
Xrystal's Avatar
Premium Member
AddOn Author - Click to view addons
Join Date: Feb 2006
Posts: 5,892
Depending on if Blizzard has acted on the request linked below since it looks like wow wasn't designed with Arabic in mind.
https://eu.forums.blizzard.com/en/wo...-client/255325

This could explain peoples attempt at getting it to work via addons partially with very little success.
__________________
  Reply With Quote
12-29-22, 02:07 PM   #5
Dridzt
A Pyroguard Emberseer
 
Dridzt's Avatar
AddOn Author - Click to view addons
Join Date: Nov 2005
Posts: 1,359
If arabic glyphs are a standard number of bytes you could convert letters to bytes and reverse those "groupings" instead of trying to use the standard string methods that work for single byte languages.

You could try running your string through this library's string.utf8reverse(s) method and see what happens.

Last edited by Dridzt : 12-29-22 at 02:11 PM.
  Reply With Quote
12-30-22, 05:52 AM   #6
Platine
A Cliff Giant
AddOn Author - Click to view addons
Join Date: Dec 2010
Posts: 72
Yes Dridzt, it was a matter of reversing the order of characters in the text.
After using the string.utf8reverse() library, Arabic text is now displayed correctly.
The only thing that can be faulted is the lack of proper connection of individual Arabic letters.
Nato fonts are OK. They just don't have Latin letters either. I liked the Cairo font the most.



  Reply With Quote

WoWInterface » Developer Discussions » General Authoring Discussion » Arabic text display

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off