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

Laura & Edward Cannon cannon.el at gmail.com
Wed Mar 4 17:26:55 CET 2009


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 it is probably the minimum amount of work.
Edward

On Wed, Mar 4, 2009 at 5:06 AM, Chris Adams <chris at stemcel.co.uk> wrote:
> 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://test.stemcel.co.uk/clients/org/org-widget/blank_badge/posted_copy_badge.png
>
> And the rollover state would be generated as well here:
> http://test.stemcel.co.uk/clients/org/org-widget/blank_badge/posted_copy_badge_rollover.png
>
> However, the issue here is that I'm trying to do this with a Postscript font
> (not a Truetype .ttf one), which needs the PSDraw class, rather than the
> basic ImageFont class, and I was under the impression that it was designed
> for printing rather than output for the screen.
>
> I'm used to using GUI apps for design related work like this or writing html
> and css on the front end of websites, and I'm very new to python, but I
> naively assumed that doing this would be simple, and it's proving not to be
> the case so far.
>
> What's the best way to try doing what I'm doing?
>
>
>
>
>
>
> --
> ---
> I'm currently only checking my email at 9am, midday and at 4pm.
> If you need a response from me urgently, please call or text my mobile, or
> contact me via Skype (chris.d.adams).
> ---
> Chris Adams
> Stemcel Studios
> The Hub
> 5 Torrens Street
> London
> EC1V 1NQ
>
> email: chris at stemcel.co.uk
> web:  www.stemcel.co.uk
> twitter:chris_d_adams
> skype: chris.d.adams
> mob: 07974 368 229
> tel: 0207 558 8971
>
> _______________________________________________
> Image-SIG maillist  -  Image-SIG at python.org
> http://mail.python.org/mailman/listinfo/image-sig
>


More information about the Image-SIG mailing list