fonts in PIL ?

Stéphane Ninin stefnin at alussinan.org
Sun Feb 8 16:22:35 EST 2004


  Hello all,

I am writing (on Linux Redhat 9)
some script to make graphs using PIL, from a set of points.

All is ok, except that there seems to be no font coming with PIL.
Where could I fond some ? 
Also, are there some real examples of use of fonts in PIL ?

Documentation says something like:

> load
> ImageFont.load(file) => Font instance
> 
> Loads a font from the given file, and returns the corresponding font 
> object. If this function fails, it raises an IOError exception.

but should "file" be the full path to the font, 
or just a font name ?

  Same question for method truetype:

> truetype
> ImageFont.truetype(file, size) => Font instance
> 
> Load a TrueType or OpenType font file, and create a font object. This 
> function loads a font object from the given file, and creates a font 
> object for a font of the given size.

> On Windows, if the given file name does not exist, the loader also looks 
> in Windows fonts directory.


Also, only true type fonts can be resized:
there is no easy way to resize standard fonts ?
(I am not a font expert :) )


Thanks in advance for your answers.


  Regards,

-- 
Stephane Ninin






 



More information about the Python-list mailing list