WoWInterface

WoWInterface (https://www.wowinterface.com/forums/index.php)
-   General Authoring Discussion (https://www.wowinterface.com/forums/forumdisplay.php?f=20)
-   -   Arabic text display (https://www.wowinterface.com/forums/showthread.php?t=59418)

Platine 12-23-22 02:32 PM

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?

Dridzt 12-23-22 03:52 PM

Something like this perhaps? https://fonts.google.com/noto/specim...s+Arabic/about

Also: https://gist.github.com/bmaupin/7cbf...9dc2d391bccbc2

Platine 12-29-22 08:10 AM

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.

Xrystal 12-29-22 12:48 PM

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.

Dridzt 12-29-22 02:07 PM

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.

Platine 12-30-22 05:52 AM

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.





All times are GMT -6. The time now is 12:10 AM.

vBulletin © 2024, Jelsoft Enterprises Ltd
© 2004 - 2022 MMOUI