Re: [Image-SIG] Using PIL to merge postscript generated text and png files

2009-03-05 Thread Laura & Edward Cannon
As far as I know, line wrapping in PIL has to be done automatically. You need to use the font.getsize(text) method in ImageFont it returns a (width, height) tuple for the given text. A little work will allow you to write a function to split the lines at the appropriate places (I would split the tex

Re: [Image-SIG] Using PIL to merge postscript generated text and png files

2009-03-04 Thread Laura & Edward Cannon
My best suggestion is to convert the font you need to a format that PIL can understand, either its own bitmap format or to a truetype font. Font conversion utilities exist, and you would only need to do the conversion once, and then just use the converted font. It may not be completely elegant, but

[Image-SIG] Using PIL to merge postscript generated text and png files

2009-03-04 Thread Chris Adams
Hi there, I'm trying to programatically generate text onto an existing png file as part of a very simple online tool for an NGO, and I'm looking at using PIL to do this. Blank badge: http://test.stemcel.co.uk/clients/org/org-widget/blank_badge/ The copy would be pasted in goes here: http: