[Image-SIG] Re: font rendering problem

Fredrik Lundh fredrik at pythonware.com
Thu Feb 10 18:34:27 CET 2005


Ron Cybulskie wrote:

>I am having problems rendering centain fonts using PIL 1.1.4 (and 1.1.5).
> One font that is causing problems is Marlett - a standard windows font.

C:\>dir \windows\fonts\marlett.ttf
 Volume in drive C has no label.
 Volume Serial Number is 1234-5678

 Directory of C:\windows\fonts

File Not Found

C:\>attrib \windows\fonts\marlett.ttf
    H      C:\windows\fonts\marlett.ttf

Secret fonts.  Interesting.

Marlett seems to be a symbol font, and contains no ordinary characters.  In
1.1.5, you can use the encoding argument to the truetype factory to specify
non-Unicode character sets; from the CHANGES file:

    + Added optional "encoding" argument to the ImageFont.truetype
      factory.  This argument can be used to specify non-Unicode character
      maps for fonts that support that.  For example, to draw text using
      the Microsoft Symbol font, use:

      font = ImageFont.truetype("symbol.ttf", 16, encoding="symb")
      draw.text((0, 0), unichr(0xF000 + 0xAA))

  (note that the symbol font uses characters in the 0xF000-0xF0FF
   range)

(but I don't know what encoding that file uses, nor what character range it uses)

</F> 





More information about the Image-SIG mailing list