align_right text bug

I think I may have found a small bug.
When displaying Arabic text using options array, and when setting align property to “right”, the first 2 letters disappear
if you set it to left or center the letters appear normally
just copy paste to main.lua, run and build html5 and run in browser
webtest2.zip (65.8 KB)

local optionsA = {
	  text="",
	  width = 400,
	  fontSize = 38,
	  font = "Tahoma",
	  align = "right"
	}
local optionsE = {
	  text="",
	  width = 400,
	  fontSize = 38,
	  font = "Tahoma",
	  align = "left"
	}
local slideT1 = display.newText(optionsA )
    slideT1.text="مرحبا انا اسمي طارق"
    slideT1.anchorY=0
    slideT1.x=display.contentCenterX
    slideT1.y=display.contentCenterY-50
    slideT1:setFillColor(1)

local slideT2 = display.newText(optionsE )
    slideT2.text="مرحبا انا اسمي طارق"
    slideT2.anchorY=0
    slideT2.x=display.contentCenterX
    slideT2.y=display.contentCenterY+50
    slideT2:setFillColor(1)


@XeduR I need an update for this :grin: and it would be great if the update included enhancing the graphics of HTML5 by default instead of zooming out to 25%

I was working on a project … an online exam after watching a course, and when I finished it I discovered this problem … the problem is 99% of users will select Arabic language, and it would be a big problem if they couldn’t read the course slide, or exam question properly

I’ve been out of commission for a while.

I did try your project on my browsers. On Firefox, there were no issues. On Chrome, I encountered the issues that you mentioned. There’s something definitely wrong with how text gets rendered on HTML5 builds, and it seems to be browser specific, but I don’t know what that is.

May sound silly, but try a leading and/or trailing " ". It might help.

it’s not silly at all … i tried it, but the problem is that in Arabic the characters are 2 bytes so it will work with some lines and corrupt others

i will check it now … at least i can force the user to use the browser that works until the issue is resolved

Solar is no longer being actively developed so you will need to find hacks to solve bugs

try using the utf8 plugin (if this works on html, I am not so sure)

RTL scripts seem to be difficult in general. I’ve been working on a bitmap font module and when it comes to RTL scripts, like Arabic or Hebrew, things just seem to go wrong.

Debugging these issues is fairly problematic for me as I don’t actually know how to read/write any such language.

Yes! Arabic language in general is tough for none Arabic speaking people … just like Chinese to myself.

One of the biggest problems is that Arabic letters has 3 or more shapes depending on the location of the letter in the word, (Beginning, Middle, End)

So the letter m will look like M or m wherever it was
in Arabic the word معمم which means generalized has 3 m letters pronounced As (Mo’ammam) each letter looks almost different but a bit similar
It can also be written as معمّم the special character above which is generally neglected in writing but pronounced resembles a stressed m or double mm

So yes Arabic language is like Brainfuck programming language in a way :joy:

I can help if you wish but I’m sure you don’t have time now to learn Arabic :joy:

What I find strange is that why does Firefox show it properly while others don’t.
Hurray for Firefox

This topic was automatically closed 180 days after the last reply. New replies are no longer allowed.