## Having Trouble Showing Text in Arabic

General discussion about LÖVE, Lua, game development, puns, and unicorns.
ARBTECH
Prole
Posts: 6
Joined: Mon Jan 14, 2019 9:25 am

### Having Trouble Showing Text in Arabic

Hey! Is there any way to show Arabic text in Love? My code:

Code: Select all

function love.load()

love.graphics.setNewFont("Font.ttf", 36)

end

function love.draw()

love.graphics.print("عَرَبِيّ")

end
Result:

zorg
Party member
Posts: 2482
Joined: Thu Dec 13, 2012 2:55 pm
Location: Absurdistan, Hungary
Contact:

### Re: Having Trouble Showing Text in Arabic

Apart from you using a file hoster that doesn't support hotlinking and probably infects computers with viruses, i don't see the issue in your image; is your issue related to the text not having the correct writing direction, or to the glyphs not using their correctly connected forms?

Edit: From what i can see from google translate, seems to be both of those issues simultaneously.
Attachments
Capture.png (8.45 KiB) Viewed 148 times
Me and my stuff True Neutral Aspirant. Why, yes, i do indeed enjoy sarcastically correcting others when they make the most blatant of spelling mistakes. No bullying or trolling the innocent tho.

pgimeno
Party member
Posts: 1440
Joined: Sun Oct 18, 2015 2:58 pm

### Re: Having Trouble Showing Text in Arabic

LÖVE doesn't support RTL rendering, or Arabic character joining. It uses only FreeType, not something that is Arabic-aware like Harfbuzz.

You could try to implement a library that is able to render Arabic.
Thrust II Reloaded - GifLoad for Löve - GSpöt GUI - My NotABug.org repositories - portland (mobile orientation)
The MS-Github repositories I had have been closed after the acquisition announcement and will be removed in the near future.

ivan
Party member
Posts: 1379
Joined: Fri Mar 07, 2008 1:39 pm
Contact:

### Re: Having Trouble Showing Text in Arabic

In addition to the letters being reversed, for Arabic I think they are disjointed into individual characters. I believe with Arabic the individual glyphs should be joined.

It's a real nightmare, I had to do a Hebrew translation of Super Chains and was forced to reverse the characters manually. The worst is where bidirectional text is involved! In that case you have to split the string into LTR and RTL (based on the UTF8 code range) and reverse each part individually!!!

While I admit this is a rare issue it would be good if this is addressed in future versions of Love2D.

ARBTECH
Prole
Posts: 6
Joined: Mon Jan 14, 2019 9:25 am

### Re: Having Trouble Showing Text in Arabic

zorg wrote:
Mon Jan 14, 2019 12:18 pm
Apart from you using a file hoster that doesn't support hotlinking and probably infects computers with viruses, i don't see the issue in your image;
Edit: From what i can see from google translate, seems to be both of those issues simultaneously.
You are right! Yes, both of those issues simultaneously.

ARBTECH
Prole
Posts: 6
Joined: Mon Jan 14, 2019 9:25 am

### Re: Having Trouble Showing Text in Arabic

pgimeno wrote:
Mon Jan 14, 2019 2:44 pm
LÖVE doesn't support RTL rendering, or Arabic character joining. It uses only FreeType, not something that is Arabic-aware like Harfbuzz.

You could try to implement a library that is able to render Arabic.
Thanks!

ARBTECH
Prole
Posts: 6
Joined: Mon Jan 14, 2019 9:25 am

### Re: Having Trouble Showing Text in Arabic

ivan wrote:
Mon Jan 14, 2019 4:13 pm
In addition to the letters being reversed, for Arabic I think they are disjointed into individual characters. I believe with Arabic the individual glyphs should be joined.

It's a real nightmare, I had to do a Hebrew translation of Super Chains and was forced to reverse the characters manually. The worst is where bidirectional text is involved! In that case you have to split the string into LTR and RTL (based on the UTF8 code range) and reverse each part individually!!!

While I admit this is a rare issue it would be good if this is addressed in future versions of Love2D.
I'm gonna look in to it, Thanks!

### Who is online

Users browsing this forum: No registered users and 2 guests