mpcabd / python-arabic-reshaper

Reconstruct Arabic sentences to be used in applications that don't support Arabic
MIT License
398 stars 80 forks source link

What need to do to stretch arabic text when synthetic text image ? #37

Closed DeepInSearch closed 4 years ago

DeepInSearch commented 4 years ago

When I use arabic font, I synthetic text image and get something like this:

testFiles_AljazeeraHD_vd14_frame_147-3 while actually in video scene, the real image will be this:

AljazeeraHD_vd14_frame_147-3 Do you know how can I stretch the arabic letter when I synthetic the text image ? What should I do ? Thanks !

mpcabd commented 4 years ago

Not sure about the context of your case, but in Unicode there is the letter \u0640 which when put between the letters will act as a stretcher, it can only be used between letters that already connect to each other.

Examples:

مرحبا مــــــرحــــــبــــــــا

As you can see above, it can't stretch between ر and حـ because the letter ر doesn't connect to the letter that comes after it.

In all cases, this is not an issue in the reshaper, so I'd advise you to post such questions on SlackOverflow, or you could just message me directly.

Good luck.