mpcabd / python-arabic-reshaper

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

Gaps between some characters #72

Closed raghada closed 2 years ago

raghada commented 2 years ago

Salam,

I'm trying to render some Arabic sentences using your library along with the the synthetic text generation package. The problem is that I'm getting Arabic sentences with some gaps between the letters, please see my code and a screenshot below:

from arabic_reshaper import ArabicReshaper

configuration = {
    'delete_harakat': True,
    'support_ligatures': True,
    'use_unshaped_instead_of_isolated': True,
}
reshaper = ArabicReshaper(configuration=configuration)
text = u' عام استقلال طهران المملكة العربية السعودية'
reshaped_text = reshaper.reshape(text)
bidi_text = get_display(reshaped_text)
generator = GeneratorFromStrings([bidi_text,],
                                 fonts=["Amiri-Regular.ttf"], size=50, character_spacing=-1)
next(generator)[0]

image

Thanks

mpcabd commented 2 years ago

This is purely a rendering problem, try a different font, and maybe a different rendering mechanism.