If i'm not mistaken then this code checks (and probably reads) the bitmap(s) in every redraw of the window.

This has two bad effects:
1) disk i/o
2) memory leaks as there is no call to XFreePixmap

For 1) there should be some caching implemented.
I believe that init*Font in XUtil.hsc already employ something similar.
Those functions also appear to take care of 2).