Extracting hte font name from a TrueType font file

Fredrik Lundh fredrik at pythonware.com
Thu Sep 18 16:28:24 EDT 2008


Steve Holden wrote:

> Does anyone have a Python recipe for this?

 >>> from PIL import ImageFont
 >>> f = ImageFont.truetype("/windows/fonts/verdanai.ttf", 1)
 >>> f.font.family
'Verdana'
 >>> f.font.style
'Italic'

</F>




More information about the Python-list mailing list