Unicode
Unicode is a character encoding that aims to represent every writing system that has ever been used.
Beginning with NetHack 5.0.0, the map can be configured to display any Unicode character to represent most map symbols - many writing systems will be of little use to NetHack, but the extensive inventory of accented Latin letters and symbols should prove quite useful. With an appropriate font mapping to the Private Use Areas, a Unicode-enabled map could in principle display tiles in the TTY and Curses ports.
Current state of support
Unicode symbols are supported in the platforms and window ports indicated in the table below.
| Window port | Platform | Support | Notes |
|---|---|---|---|
| TTY | Linux and Mac | Yes | |
| TTY | Windows | Yes | |
| TTY | MS-DOS | Yes | |
| Curses | Linux and Mac | Yes | |
| Curses | Windows | Yes | If building with MingW, provide WANT_GUICURSES to switch to PDCursesMod and enable supplementary characters. (This also enables the Curses port on NetHackW.) |
| Curses | MS-DOS | Yes | If WANT_DOSVGA is specified at build time |
| Win32 | Windows | Yes | |
| Qt | Windows, Linux and Mac | Yes | |
| X11 | Linux and Mac | Yes | No supplementary characters |
| Amiga | Amiga | No |
The following information pertains to an upcoming version (NetHack 5.0.1). If this version is now released, please verify that the information below is still accurate, then update the page to incorporate it.
As of commit 94336e6b, the X11 interface can be built with support for Xft. If such support is included, the supplementary planes will work.How to configure
The file "symbols" contains several configurations for the map. In the supplied configuration, "Enhanced1" specifies a basic set of Unicode characters, and "Enhanced2" makes use of a few more characters.
A character may be specified using this form:
S_vwall: U+2502
The quoted form used for other symbol types is not supported.
One may specify a symbol for a specific monster as follows:
G_female_giant_ant: U+E000
One glyph symbol is defined for every glyph code. About half of these codes can never occur; the largest reason is that eight glyphs are allocated for swallow attacks for each monster, but only a few monsters can swallow.
Color can be assigned to each glyph:
G_female_giant_ant: U+E000/200-100-50
The numbers are intensity for red, green and blue, ranging from 0 to 255
Some named colors are available as well, as defined in src/coloratt.c:
G_female_giant_ant: U+E000/slate-blue
Outstanding bugs
- Combining sequences are not supported.
- Some configurations may not support supplementary characters or full color.
- A large number of configured symbols may cause delays in starting the program.
- G_ symbols for objects work, but S_ symbols still seem to be broken.
- The --dumpglyphnames option is not supported on all platforms.
