Wednesday, May 19, 2010

GNUmed on Windows - what is in the box ? a Unicode font tale

Despite the fact that noone complained I recently found myself looking at boxes again. That means instead of nice Unicode symbols like a hand signing something the default installation of GNUmed on Windows XP will show you nothing but a box. Windows is pretty creative at showing boxes. It will simply show a box for every character it cannot display.

Who is to blame. Initially I thought python was to blame. I did everything to make the text aware of utf-8 encoding. Turns out it already is and nothing changed. I then thought the Windows codepage is to blame. I managed to set it to Unicode instead of CP850 but it would still show me a box. Then it (not the box) hit me. The font is to blame.

Default font on Windows XP is Arial and Tahona. Both do not have a character mapped to the unicode number for the signing hand. The solution is to change the font to a font that includes the signing hand.

Easier said then done. For a signing hand in the title of a Window you need to change the font via Windows system preferences in the Appearance section. For the signing hand in e.g. a lab measurement cell in GNUmed you need to tell wxpython and therefore GNUmed that you want another font.

Many hours later the real challenge was near. Which font to use ? Not many fonts that have all characters exist. Many look lets say special (ugly) and no user will activate it if the text looks ugly in GNUmed.

It boils down to:

MS Arial Unicode - almost complete, commercial ($99) font, ships with some MS Office versions, cannot be shared
Code 2000 - most complete one, Shareware, looks lets say ok, cannot be shared
DejaVu Sans - almost complete, ships with Windows , looks good.

Apparently the Linux version of DejaVu Sans is more complete then the Windows version. If this holds true and the Linux version runs in Windows I will optionally ship it in the installer.

A couple of changes to the GNUmed code are neccessary before you can finally enjoy GNUmed unboxed.

Take care,
Sebastian

No comments: