I wrote a script which draws a simple text and saves it using PIL.
import Image, ImageDraw, ImageFont
def get_text(text, size):
img = Image.new('RGBA', (250, 80))
font = ImageFont.truetype('HelveticaLTStd-Light.otf', size, encoding='unic')
draw = ImageDraw.Draw(img)
draw.text((0, 0), text, fill='#000000', font=font)
img.save('text.png')
if __name__ == '__main__':
get_text('test', 64)
When viewing the result on Linux (Ubuntu 11.10) everything is fine with the image:
But on Windows 7 PIL cuts the text off:
On Linux I simply used apt-get install
to install PIL. On Windows I installed PIL using the binaries by Gohlke (http://www.lfd.uci.edu/~gohlke/pythonlibs/). I use Python 2.7 and PIL 1.1.7
Is this problem an OS issue or is there something wrong with my code?
Thank You.