![]() ![]() Text = bidi_text.encode().decode('utf-8') #encoding problem (rectangular boxes!) Reshaped_text = arabic_reshaper.reshape(text_to_be_reshaped) # seperated chars problemīidi_text = get_display(reshaped_text) #direction problem # install: pip install arabic-reshaperįrom PIL import Image, ImageFont, ImageDraw The last one is the simplest, just change the encoding to utf8. ![]() ![]() For example (سلام and سلام )įor the 1st problem we have to use the Unicode bidirectional algorithm, which is implemented in python-bidi.įor the 2nd problem arabic_reshaper works well, even with Persian characters such as ژ, پ, گ and چ. Shape problem (characters are in the isolated form, which means that every character is rendered regardless of its surroundings). Many problems can occur for Persian(Farsi) or Arabic fonts, including: ![]()
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. Archives
March 2023
Categories |