Ned Batchelder wrote: > OK, here's some code, and some output.... After looking, and doing a bit of experimenting, here is a surprising drawing:
import Image, ImageDraw, ImageFont def paints(fontname='timesbi.ttf', fontsize=50, canvas=(500, 700), position=(100, 100)): im = Image.new("RGB", canvas, '#ffffc0') draw = ImageDraw.Draw(im) font = ImageFont.truetype(fontname, fontsize) fh, fx = font.getmetrics() x, y = position for text in ['j_0_|igf', ' j_1_|igf', ' j_2_|igf', 'young']: width, height = font.getsize(text) # w,h draw.rectangle((x, y, x+width, y+height), fill='lightgrey', outline='lightgreen') draw.rectangle((x-fx, y, x, y+fh), fill='lightgrey', outline='red') draw.text((x, y), text, font=font, fill='black') y += 100 return im paints().show() -- Scott David Daniels [EMAIL PROTECTED] _______________________________________________ Image-SIG maillist - Image-SIG@python.org http://mail.python.org/mailman/listinfo/image-sig