New Label Method

A project log for Thumb Keyboard

Experimental thumb keyboard, suitable for a hand held device

david-boucherDavid Boucher 08/11/2019 at 08:561 Comment

I'm working on a new method for producing the labels. The existing system (mis)uses a spreadsheet, but I would like something better.

The new method uses a Python program with the Python Image Library (PIL) to create a bitmap image of the labels. The required layout will be defined in a separate file that the program will process. The resulting bitmap can then be

So far I've hit a couple of snags. The first one is that despite the resulting bitmap having a DPI setting to indicate what size it should be printed at, many programs that print bitmaps "helpfully" scale it to fit the page, even when I think I've turned off all the "scale to fit page" options. I've found that GIMP will print at the correct size as long as I don't print preview first.

I can't control what software will be used to print the bitmap, so I've added a couple of scales, one in centimetres and one in inches, so at least you can check if it's printed correctly.

The second snag is that fonts in PIL are not anti-aliased, reducing the print quality. Producing the bitmap at a higher resolution should work around this.

This is not finished yet but when it is I'll compare it with the old method to see if it's worth switching.


mikekscholz wrote 02/20/2020 at 04:09 point

The most reliable way Ive found to accurately reproduce sizes with prints is with PDF files, I dont know how helpful that will be with PIL but I think python libs exist for pdf files. as for anti-aliasing 300x300 pixels per inch should be sufficient for high quality without being overkill.

  Are you sure? yes | no