This page describes step-by-step how you can install X fonts on
a UNIX system running X-windows. As an example I use the
jiskan16 font which contains 16x16 bitmaps of the
Japanese kanji glyphs. I assume you already fetched
jiskan16.bdf.
bdftopcf over each of them:
bdftopcf jiskan16.bdf > jiskan16.pcf
The pcf fonts will load much faster than the
bdf sources since they are compiled.
compress:
compress jiskan16.pcf
This replaces jiskan16.pcf with a smaller file
named jiskan16.pcf.Z.
mkfontdir:
mkfontdir .
assuming that your current directory is the directory with the
fonts. This command will create a file called
fonts.dir in the directory containing the fonts.
The fonts.dir file contains ASCII so you can display
its contents with "more fonts.dir".
It will look similar to:
1
jiskan16.pcf.Z -jis-fixed-medium-r-normal--16-150-75-75-c-160-jisx0208.1983-0
The first line indicates how many fonts are stored in this directory (in this case just one font). The remaining lines in the file have two fields per line. The first field is the file name of the font. The second field is the X font name of the font.
Although this might not be the best time and place to explain all these strings and numbers in the font name let me mention the most important ones (you can skip this if you're not interested):
- 75-75
- The screen resolution this font was designed for. If your screen has a different resolution (like 100 dpi) you can still use this font, it just looks smaller.
- 16
- The pointsize of the font. If your screen is 100 dpi the font will not display at 16 point but at
75*16pt/100 (~=12pt).- jisx0208.1983-0
- The encoding of the font. The encoding of a font relates input character codes to glyphs in the font.
xset fp+ /full/path/to/font/directory
Check the current font path with the X command:
xset -q
fonts.dir files:
xset fp rehash
To check if the new fonts are known to the X-server check the
fonts.dir file for the name (second column) of one
of the newly installed fonts and next execute:
xfd -fn -jis-fixed-medium-r-normal--16-150-75-75-c-160-jisx0208.1983-0
This should display the 16 point kanji font in the font browser.
If you don't have the xfd program try the command:
xlsfonts | grep jis
and see if the new fonts are listed.