Font management under win32

Fredrik Lundh fredrik at pythonware.com
Fri Sep 30 06:20:45 EDT 2005


Stefano Masini wrote:

> Do you think that is possible with win32 extensions?

you can do this via PIL's ImageFont module:

>>> import ImageFont
>>> f = ImageFont.truetype("arial.ttf")
>>> f.font.family
'Arial'
>>> f.font.style
'Regular'

or, if you don't want to ship the entire PIL library with your app, you
can grab the _imagingft module and use low-level functions:

>>> import _imagingft
>>> f = _imagingft.getfont("c:/windows/fonts/arial.ttf", 0)
>>> f.family
'Arial'
>>> f.style
'Regular'

</F> 






More information about the Python-list mailing list