title: Using pixel fonts in PIL
body: <p>I am creating images using PIL that contain numerous exactly placed text strings.  My first attempt was to convert pixel fonts into the pil-compatible format as described <a href="http://llbb.wordpress.com/2006/11/24/making-pil-font-for-python-image-library/" rel="nofollow noreferrer">here</a>.  For example, I download the Silkscreen font and convert it:</p>
  
  <pre><code>otf2bdf -p 8pt -o fonts/slkscr.bdf fonts/slkscr.ttf 
  pilfont.py fonts/slkscr.bdf
  </code></pre>
  
  <p>I can then use the font in PIL like so:</p>
  
  <pre><code>import Image, ImageDraw, os, sys, ImageFont
  im = Image.new("RGB", (40,10))
  draw = ImageDraw.Draw(im)
  fn = ImageFont.load('fonts/slkscr.pil')
  draw.text((0,0), "Hello", font=fn)
  del draw
  # write to stdout
  im.save(sys.stdout, "PNG")
  </code></pre>
  
  <p>However, the resulting image (<img src="https://i.stack.imgur.com/L4koP.png" alt="alt text">) does not reflect what the font <a href="http://kottke.org/plus/type/silkscreen/" rel="nofollow noreferrer">should look like</a>.</p>
  
  <p>What procedure should I be using to convert and use pixel fonts so that they render as intended?</p>
  
  <p>Thanks in advance.</p>