General discussion about LÖVE, Lua, game development, puns, and unicorns.
-
ARBTECH
- Prole
- Posts: 6
- Joined: Mon Jan 14, 2019 9:25 am
Post
by ARBTECH » Mon Jan 14, 2019 11:11 am
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: 2500
- Joined: Thu Dec 13, 2012 2:55 pm
- Location: Absurdistan, Hungary
-
Contact:
Post
by zorg » 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; 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 748 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: 1494
- Joined: Sun Oct 18, 2015 2:58 pm
Post
by pgimeno » 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.
-
ivan
- Party member
- Posts: 1393
- Joined: Fri Mar 07, 2008 1:39 pm
-
Contact:
Post
by ivan » 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.
-
ARBTECH
- Prole
- Posts: 6
- Joined: Mon Jan 14, 2019 9:25 am
Post
by ARBTECH » Mon Jan 14, 2019 4:55 pm
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
Post
by ARBTECH » Mon Jan 14, 2019 4:58 pm
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
Post
by ARBTECH » Mon Jan 14, 2019 5:00 pm
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!
Users browsing this forum: No registered users and 5 guests