KwangYul Seo wrote:

> I draw fonts using ImageFont module. I have two questions on ImageDraw 
> module.
> 
> 1. What is the unit of font size?
> 
> ImageFont.trutype(file, size) can specify the font size as its second 
> argument. I specified font size 10, but the output text seems to be 
> smaller than 10.

The relation between the font size and the text height is determined by 
the font designer; usually, the given size is the *smallest* line height 
you will want to use for the font you get back.  See Ned's post for a 
link to a more complete discussion.

 > 2. What is the best way to get a list of fonts which can be passed to 
 > ImageFont.truetype(file, size)? Certainly, I can scan Windows system
 > fonts under C:/WINDOWS/Fonts, but it does not look like a portable
 > way.

There's no code for this in current PIL releases.

The following module might help; it's a work-in-progress for AggDraw, 
but should be fairly easy to adapt to both PIL and your requirements:

     http://svn.effbot.org/public/stuff/sandbox/agglib/aggfont.py

</F>

_______________________________________________
Image-SIG maillist  -  Image-SIG@python.org
http://mail.python.org/mailman/listinfo/image-sig

Reply via email to