Nethack 12x12 and 16x16 Tile Font

Sometimes (e.g, when playing at I play Nethack through a terminal, and not with tiles like I am used to. I mostly use xterm then, and I do it most often because I am logged in from remote, and ssh's X11-forwarding is too slow. However, I find the standard nethack text-rendering a bit too oldfashioned, so I set out to do something about it.

First, I tried Thomas Fine's Big X11 Nethack Font, but I ran into trouble. This font uses characters that are unprintable in an xterm, and also I have taken a liking to the X11 nethack tiles so I cannot quite get used to the look Tom's font gives.

I started mapping the charaters that are actually printable in an xterm, and it turns out that there are 191 of them (this amounts to the whole ISO 8859-1 character set). Then I noticed that when playing Nethack with colors enabled, some symbols are printed in a bold font. The bold look is normally done by overstrike, i.e. duplicating the character bitmap one pixel to the right. However, if a font exists that is the bold counterpart to the font specified for the xterm, xterm will use this font instead. That means that all nethack symbols that are written with the bold font can actually have a totally different look, and this increases the number of possible tiles quite a lot.

Source-diving a little to find out which symbols are written in bold, I created two fonts based on the X11 tile set. In addition to tiles, the fonts contain an almost full set of the ASCII printable characters, except for some letters that are seldom or never used by Nethack other than in "graphical" context. So, to be able to distinguish between the most important Nethack traps, I decided to redefine @&{} as tile symbols as well. I am quite pleased with the result. Here is screenshot:

Quite tile-like isn't it? Some tiles were difficult to convert into two-color characters, most notably I have had to reinvent the gold and the stairs symbols. Playing nethack with the font is a tiny bit confusing at first, because not all monsters and objects are what they seem. For instance, all tools look like a chest except yellow and white tools which look like a lamp. However, once you learn what color the different monsters are (disenchanters are blue, for one), you can most often spot the baddies in the crowd.

One problem is that the 16x16 font requires a screen width of 1280, which is not always available. Therefore, I squeezed the font down to 12x12, while trying to retain the same look and feel as the old font had. The screenshot then looks like this:

It looks almost the same, doesn't it, and it only requires a screen width of 960 pixels.

Full fontal views (taken from the bdfedit font editing program by Thomas Fine):

If you are inspired to improve some characters, I'll be glad to include your contribution.

Getting and Using it

I've only tested this with Nethack 3.4.x!

Download the following files:

nethack16.bdf 16x16 nethack font
nethack16B.bdf 16x16 bold nethack font
nethack12.bdf 12x12 nethack font
nethack12B.bdf 12x12 bold nethack font
nethackconfig.txt configuration for version 3.4. Add this to your .nethackrc file

To install the font, do the following:

> mkdir fonts
> cd fonts
> chmod 755 .
> mv <the-font-files-from-wherever-you-saved-them> .
> mkfontdir
(The following chmod makes xset happy)
> chmod 644 fonts.dir *.bdf
> xset +fp `pwd`
> xset fp rehash
This defines the following fonts that can be accessed by X programs:
To run the game, start an xterm with one of the "medium" fonts, and the bold font will automatically be loaded as well. Like this:
> xterm -fg white -bg black -font -misc-nethack-medium-r-normal--24-160-100-100-c-160--custom &
White on black is best. The normal xterm colors are not the best for playing nethack. The screendump above was made by starting xterm in the following manner:
> xterm \
-fg white -bg black -cr red +sb -en "ISO 8859-1" \
-font -misc-nethack-medium-r-normal--24-160-100-100-c-160--custom \
-xrm "xterm*color0:#000000" -xrm "xterm*color1:#d00000" \
-xrm "xterm*color2:#00b000" -xrm "xterm*color3:#c07000" \
-xrm "xterm*color4:#3030ff" -xrm "xterm*color5:#c800c8" \
-xrm "xterm*color6:#00c8c8" -xrm "xterm*color7:#d0d0d0" \
-xrm "xterm*color9:#ffb000" -xrm "xterm*color10:#40ff00" \
-xrm "xterm*color11:#ffff40" -xrm "xterm*color12:#0090ff" \
-xrm "xterm*color13:#ff00ff" -xrm "xterm*color14:#70ffff" \
-xrm "xterm*color15:#ffffff" \
-e telnet &
My advice, put it in a script (perhaps together with "xset +fp ..." and "xset fp rehash") and be done with it.

-- Roar Lauritzsen