Hi,

I am trying to add tamil water marking to a image through python.
letters composed of multiple unicode charters are not getting
rendered/displayed properly.
e.g.
ஸ்ரீபுவே - are not getting displayed properly.

# -*- coding: utf-8 -*-
from PIL import Image, ImageDraw, ImageFont, ImageEnhance
import os, sys
import unicodedata
font=ImageFont.truetype("/home/sample/elcotuni.ttf",32)

in_file='sky.jpeg'
text = u'அபிபுஷ்பம் இந்துமதி ஸ்வேதா ஸ்ரீதேவி'
print text
out_file='sky2.jpeg'
angle=90
opacity=0.5
img = Image.open(in_file).convert('RGB')
watermark = Image.new('RGBA', img.size, (0,0,0,0))
size = 20
draw = ImageDraw.Draw(watermark, 'RGBA')
draw.text((20,20),text,font=font,fill=(255,0,255))
Image.composite(watermark, img, watermark).save(out_file, 'jpeg')



unicode ttf dowload: http://www.elcot.in/tamilfonts_download_list.php
input jpeg file: you can use any jpeg file

Any suggestion to fix this


Thanks,
Rajesh
_______________________________________________
ILUGC Mailing List:
http://www.ae.iitm.ac.in/mailman/listinfo/ilugc
ILUGC Mailing List Guidelines:
http://ilugc.in/mailinglist-guidelines

Reply via email to