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

AttributeError: 'ImageFont' object has no attribute 'getmask2' #76

Closed mutairibassam closed 2 years ago

mutairibassam commented 2 years ago

I was trying to add Arabic text in an image but faced this exception AttributeError: 'ImageFont' object has no attribute 'getmask2'. (Implementation without font)

After investigation, it seems the default font is not handled so a specific font need to be passed. (Implementation with font)

Why the default font is not handled?

mpcabd commented 2 years ago

First, this is definitely not an issue with the reshaper itself 👎

The problem, as far as I understand, is that the default font is not TrueType, so it won't handle Unicode characters properly. You can investigate further if you like, but in any case, you must always use a font that supports Arabic.