» Contents
» (0) Quickstart
» (1) Introduction
» (2) Installation & setup
» (2.5a) Custom fonts
» (3) Creating a character & starting to play
» (4) The world
» (5) Item and flag details, elements
» (6) Monster details
» (7) Character details
» (8) Tactics & strategy
» (9) Miscellanous

Search
Previous
(2.5) Fonts
Next
(3) Creating a character & starting to play
(2.5a) Custom fonts                                                             
-------------------
It is possible to create your own custom fonts for the game.
For the Windows client which uses .FON files you can use "Fony" for example:
http://hukka.ncn.fi/?fony
(Up to client 4.6.1a it was not possible to use characters of numbers 128-255
but this has been addressed, so the full range of characters is available now.)

For the Linux client you'll need to convert the font to 'pcf' format, but 'bdf'
might work too, depending on your system.
Place it into a registered fonts folder (check 'xset -q'), usually that can be
/usr/share/fonts/misc, let fontconfig rescan it with 'fc-cache' (optionally
with '-f' to force rescan) and also have X rescan it with 'xset fp rehash' and
then run 'sudo mkfontdir' in /usr/share/fonts/misc (if that's the folder where
you placed the fonts) to add them to fonts.dir file.
You can verify that all is fine by doing 'fc-list' and 'xlsfonts'. TomeNET
doesn't use fontconfig but it's probably a good idea to register the fonts in
both, fontconfig and X11. (TomeNET uses XListFonts() to read available fonts.)
Note that TomeNET only auto-scans fonts that contain a (lower-case) 'x' letter,
eg fonts whose names contain a <width>x<height> info. After this another filter
will be applied via the (exactly one!) regular expression specified in the file
'lib/xtra/fonts-x11-menuscan.txt'.
To add other fonts that don't match these criteria, you have to add their names
manually in the file 'lib/xtra/fonts-x11-menuscan.txt'.
When using a custom font that has different mapping than standard fonts you
might need to turn off the option 'font_map_solid_walls' in = 1 if you spot
any wall tiles that look not like they are supposed to in that particular font.
Fedora 33: Tokariew wrote information about installing fonts on this OS here:
 https://github.com/TomenetGame/tomenet/issues/15

Since you might need/want to use mapping files to remap terrain features to the
characters in your font, you can create font-preference files that contain
mapping information.
The default font mapping file is lib/user/font-win.prf (for Windows OS). If it
exists, this file will automatically be loaded by the game client.
However, the client first checks for the existance of a specific, custom font
mapping file that has a filename: lib/user/font-custom-FONTNAME.prf and loads
this instead of attempting to load font-win.prf.
This allows you to have a custom mapping file for each of your fonts.

NOTE: Since client 4.7.0 the TomeNET/lib/user folder is copied to your Windows
user folder (usually C:\users\...\TomeNET-user) to fix problems with Windows 7
and higher. This copy is then used instead.

Example:
You go to the fonts menu by pressing = f and switch to a font named 10X16X.FON.
Now the client will automatically try to not only load the font from the font
folder lib/xtra/font/10X16X.FON but also a mapping file to go with it, named
lib/user/font-custom-10X16X.prf.
(On switching fonts, the client will automatically discard all mapping info it
loaded for the previously used font.)

Note that this mapping file loading only happens if you switch the font for the
main window, not when you switch fonts of the subwindows.

Font mapping files have the following syntax for mapping lines:
  F:index:attribute/character
  R:index:attribute/character
  U:tval:attribute/character
with 'attribute' and 'character' being optional.
Servers of internal version > 4.9.1 (using git code from 3. Jan 2024 or later)
can also process client mappings of objects, done in similar manner to above:
  K:index:attribute/character

'Attribute' is the colour, these are listed as TERM_ constants in defines.h.
'Character' is the (possibly ASCII) index in the custom font file.

F-lines:
The 'F' stands for 'feature', meaning a specific terrain tile such as floors,
walls, doors. You can see all of these in the file lib/game/f_info.txt, the
index of each feature is the number located right after 'N:'.

R-lines:
The 'R' stands for 'monster', meaning a specific base monster type. You can see
all of these in the client's in-game monster lore (~7) or in the spoiler file
lib/game/r_info.txt. The monster index is the number located right after 'N:'.
You can also use Mikael's monster search website under ~R .

U-lines:
The 'U' stands for 'unknown type', meaning a specific base object type (tval).
You can see tvals in the client's lib/game folder in file k_info.txt, it's the
first number after "I:" within an item definition block.
This mapping will be used for flavoured (ie coloured) items that you don't know
yet, for example potions, scrolls, mushrooms, magic devices.

K-lines:
The 'K' stands for object 'kind', meaning a specific object kind. You can see
all of these in the client's lib/game folder in file k_info.txt. The index is
the number right after "N:" at the very beginning of an item definition block.

These mapping lines will remap the specified feature or monster to the symbol
with the number 'character' in your font, which may range from 0 to 255, and
display it in the colour 'attribute' which may range from 0 to 55 (up to 4.6.1a
client) or 57 (in later clients), with colours 0 to 15 being static colours and
the higher ones being animated.

Problems have been reported for mapping certain characters:
0, 2, 16..27 (unclear), 21..31, 129, 141, 143, 144, 157, 195.
There is currently no further information available regarding this issue.
If those don't work for you, just pick different ones.

Examples:

  F:56:2/127
Maps the terrain feature 'granite wall' (#56 in f_info.txt) to the font symbol
#127 and the colour 2 (which is 'slate').

  R:862:/255
Maps the monster 'Morgoth, Lord of Darkness' (#862 in r_info.txt and in ~6) to
the font symbol #255, leaving its colour at its normal value (the one given in
r_info.txt) without changing it.

When using a custom font you probably want to turn off the option
'font_map_solid_walls' in = 1, as it interferes with the mapping of various
wall tiles: It will force-remap all affected wall tiles to character 127 for
Windows clients and to character 2 for Linux/OS X clients and all treasure
veins ('*' symbol in the game, aka walls with treasure to mine) to character 1,
which looks like a diamond in the standard fonts.
It will also change the colour of quartz veins form default 'white' or whatever
else it was mapped to, to light grey to make them visually distinguishable from
other walls.


Here is a list of all supported colours:
----------------------------------------
Static colours:
 0  black           1  white           2  slate           3  orange
 4  red             5  green           6  blue            7  umber
 8  dark grey       9  light grey     10  violet         11  yellow
12  light red      13  light green    14  light blue     15  light umber
Animated (flickering in multiple hues) colours:
16  multi          17  poison         18  fire           19  cold
20  acid           21  electricity    22  confusion      23  sound
24  shards         25  light          26  darkness       27  mana-shield
28  invulnerable   29  curse          30  annihilation   31  half-multi
32  psi            33  nexus          34  nether         35  disenchantment
36  inertia        37  force          38  gravity        39  time
40  meteor         41  mana           42  disintegration 43  water
44  ice            45  plasma         46  detonations    47  nuke (toxic waste)
48  unbreath       49  holy orb       50  holy fire      51  hellfire
52  thunder        (53  lamp)         (54  dark lamp)    55  ember
(56 thin fire)     57  starlight


For the Linux/OS X client you'll need to either convert FON fonts to PCF format
(bitmap font files) or create fonts directly in PCF format.
Add them to your system with the usual font-adding procedures for your specific
Linux distribution, then you can select them in TomeNET via  = f  (or enter
them directly in your .tomenetrc config file).
Previous
(2.5) Fonts
Next
(3) Creating a character & starting to play