Difference between revisions of "Unicode"

From NetHackWiki
Jump to navigation Jump to search
(Current state of support: TTY on MS-DOS)
(adjust lede)
Line 1: Line 1:
 
{{wikipedia}}
 
{{wikipedia}}
Beginning with [[NetHack 3.7.0]], the map can be configured to display any '''Unicode''' character to represent most map symbols. Unicode is a character encoding that aims to represent every writing system that has ever been used. 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 [[wikipedia:Private Use Areas|Private Use Areas]], a Unicode-enabled map could in principle display [[tiles]] in the [[TTY]] and [[Curses]] ports.
+
'''Unicode''' is a character encoding that aims to represent every writing system that has ever been used.
 +
 
 +
Beginning with [[NetHack 3.7.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 [[wikipedia:Private Use Areas|Private Use Areas]], a Unicode-enabled map could in principle display [[tiles]] in the [[TTY]] and [[Curses]] ports.
  
 
{{upcoming|NetHack 3.7.0|Unicode support is still incomplete.}}
 
{{upcoming|NetHack 3.7.0|Unicode support is still incomplete.}}
Line 54: Line 56:
  
 
==Outstanding bugs==
 
==Outstanding bugs==
 
 
* Not all configurations support Unicode, and many that do support it do not support full color.
 
* Not all configurations support Unicode, and many that do support it do not support full color.
 
* All configurations in "symbols" that declare Unicode get parsed as a single configuration.
 
* All configurations in "symbols" that declare Unicode get parsed as a single configuration.

Revision as of 23:50, 9 October 2022

Unicode is a character encoding that aims to represent every writing system that has ever been used.

Beginning with NetHack 3.7.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.

The following information pertains to an upcoming version (NetHack 3.7.0). If this version is now released, please verify that it is still accurate, then update the page to incorporate this information.

Unicode support is still incomplete.

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 No
Curses MS-DOS Yes If WANT_DOSVGA is specified at build time
Win32 Windows No
Qt Windows, Linux and Mac No
X11 Linux and Mac No

How to configure

The file "symbols" contains several configurations for the map. In the supplied configuration, "Enhanced1" specifies Unicode 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

Outstanding bugs

  • Not all configurations support Unicode, and many that do support it do not support full color.
  • All configurations in "symbols" that declare Unicode get parsed as a single configuration.
  • Many configured symbols may cause delays in starting the program.
  • Symbols for objects are accepted but not displayed. The default ASCII characters appear instead.
  • The --dumpglyphids is not supported on all platforms.