--- Luc Tonin [EMAIL PROTECTED] wrote:
thx for your help
but i don t find the font files ( courR14.pil and
courR14.bpm)
!!!
Sorry for the late reply, I don't check this list
until after work.
If you have X windows and you have fonts in the bdf or
pcf format you can use the script that comes with PIL
called pilfont.py to create fonts.
Also, I took a few of my fonts, formatted them, zipped
em up, and put them in my zope.org member folder.
a
href="http://www.zope.org/Members/byron/fonts.tar.gz"http://www.zope.org/Members/byron/fonts.tar.gz/a
hope this helps.
Jason
- Message d'origine -
De : Jason Byron [EMAIL PROTECTED]
À : Luc Tonin [EMAIL PROTECTED]
Cc : [EMAIL PROTECTED]
Envoyé : mercredi 13 décembre 2000 07:10
Objet : Re: [Zope] PIL problem
--- Luc Tonin [EMAIL PROTECTED] wrote:
well
i m still trying to insert some text in a gif
image
using PIL
but what should i do??? using da PSDraw class??
does anybody have an id ??
thx by advance
I recently got that working for me by doing a few
tricky things:
created a directory in Extensions called "BDF" and
put
the font files (courR14.pil an courR14.pbm) in
there.
(make sure that dir is zope readable)
then add ImageFont to your PIL init script. (kind
of
like the file replacement in ZPhoto does)
then in your external method and the import
statement
for the fonts. (in mine I did "import
PIL.ImageFont")
and then I experimented around and got the
following
code to setup the font stuff:
wd = os.environ['PYTHONHOME']
wd_ext = wd + '/Extensions'
wd_ext_bdf = wd_ext + '/BDF'
sys.path[:0] = [wd_ext] # prepend the font path
sys.path[:0] = [wd_ext_bdf]
font = PIL.ImageFont.load_path("courR14.pil")
I put this in the global part of the external
method
and the rest of the methods could use fonts.
(for some reason I couldn't get any other font to
work. courR14 is the default in the PIL library.
to
change
fonts you can simply save another font as the
courR14
name)
After that you can use fonts in your methods with:
draw = PIL.ImageDraw.Draw(image)
draw.text((x,y),"text to print")
Hope this helps.
I will *hopefully* be releasing a zope product in
the
near future that uses PIL fonts so you can use it
as
an example. Right now I'm ironing it out a
little,
but keep an eye out for it. I think I'm going to
call
it "NetMap"
Jason
__
Do You Yahoo!?
Yahoo! Shopping - Thousands of Stores. Millions of
Products.
http://shopping.yahoo.com/
__
Do You Yahoo!?
Yahoo! Shopping - Thousands of Stores. Millions of Products.
http://shopping.yahoo.com/
___
Zope maillist - [EMAIL PROTECTED]
http://lists.zope.org/mailman/listinfo/zope
** No cross posts or HTML encoding! **
(Related lists -
http://lists.zope.org/mailman/listinfo/zope-announce
http://lists.zope.org/mailman/listinfo/zope-dev )