Created
December 17, 2009 17:55
-
-
Save j2labs/258902 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from arabic_rtlize.process import rtlize | |
from PIL import Image, ImageFont, ImageDraw | |
real_urdu = "اس صفحہ کو ترامیم کیلیۓ نـیـم محفوظ کر دیا گیا ہے اور صارف کو اندراج کر کے داخل نوشتہ ہونا لازم ہے۔" | |
urdu = rtlize(unicode(real_urdu, 'UTF-8')) | |
img = Image.new("L", (1000,200)) | |
draw = ImageDraw.Draw(img) | |
f = ImageFont.truetype('/Users/jd/Desktop/urduimg/geeza.ttf', 20) | |
draw.text((10,40), urdu, fill=255, font=f) | |
img.save('/Users/jd/Desktop/pil.png', optimize=1) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment