1UNIFONT(5) File Formats Manual UNIFONT(5)
2
3
4
6 Unifont - a bitmapped font with full Unicode Plane 0 (BMP) coverage
7
9 unifont.hex
10
12 Unifont is a bitmapped font with glyphs described in a plain text file,
13 generically referred to as unifont.hex herein. This man page describes
14 the format of three related files: unifont.hex, masks.hex, and combin‐
15 ing.txt. All three of these files start with a Unicode code point as a
16 hexadecimal string, with code points appearing in ascending order.
17
18 A unifont.hex file consists of single-line entries for each Unicode
19 code point. Each line contains the code point, a colon (':') field
20 separator, and the glyph bitmap. The glyphs in a unifont.hex format
21 file must appear in ascending Unicode code point order.
22
23 This file can be converted into a BDF font using the hex2bdf(1) pro‐
24 gram, and into a TrueType font using fontforge(1) (which is not part of
25 this package). The BDF font can also be converted into a PCF font
26 using bdftopcf(1) (which is also not part of this package).
27
28 The first field
29 The first field is the Unicode code point in hexadecimal, rang‐
30 ing from "0000" through "10FFFF", inclusive. This corresponds
31 to the Unicode code points U+0000 through U+10FFFF, respec‐
32 tively.
33
34 The second field
35 The second field is the glyph's bitmap string. This is a series
36 of hexadecimal digits. Currently Unifont encodes two glyph
37 sizes: 8 pixels wide by 16 pixels tall (single-width), and 16
38 pixels wide by 16 pixels tall (double-width). A third format of
39 32 pixels wide (drawn as 31 pixels plus a pixel on the right
40 that is always blank) by 16 pixels tall (quadruple-width) is
41 also available, but only for experimental use.
42
43 As each hexadecimal digit can encode four bits, one pixel row of
44 a glyph is either two hexadecimal digits long (single-width) or
45 four hexadecimal digits long (double-width). The glyphs are 16
46 pixels tall, so a single-width glyph is (2)(16) = 32 hexadecimal
47 digits long and a double-width glyph is (4)(16) = 64 hexadecimal
48 digits long.
49
50 Previous versions of this package supplied a file named masks.hex.
51 This file followed the same format as unifont.hex with a first field
52 that was a Unicode code point in hexadecimal, followed by a colon (':')
53 field separator, followed by a second field that was a hexadecimal
54 string representing a glyph bitmap. Code points were in ascending
55 order. The glyph bitmaps were bitmaps that would be exclusive-ored
56 with the glyph in unifont.hex that had the same code point. The origi‐
57 nal unifont.hex contained combining circles as depicted in The Unicode
58 Standard. When Paul Hardy got combining characters to display properly
59 in the TrueType version, it became desirable to remove these combining
60 circles for proper display with unifont.ttf. The program uniunmask(1)
61 will read such a masks.hex file, read a unifont.hex format file, and
62 apply the exclusive-or masks in masks.hex to unifont.hex. The output
63 is another file in unifont.hex format with the masked-off bits (i.e.,
64 combining circles) removed.
65
66 Because the operation is an exclusive-or, masks.hex could also be used
67 to turn on pixels in selective glyphs, for example to add combining
68 circles to selective glyphs that do not show them. However, the pro‐
69 gram unigencircles(1) can do this without a separate masks.hex file.
70 Thus masks.hex is no longer supplied with this package. uniunmask(1)
71 remains part of this distribution in case someone might find creating a
72 custom masks.hex file useful for another purpose.
73
74 The TrueType version of the font, unifont.ttf, and the unigencircles(1)
75 utility both read a file combining.txt. This file appears in the
76 directory font/ttfsrc. The combining.txt file is a list of code points
77 as hexadecimal strings, one per line in ascending order, of Unicode
78 code points that show combining circles in The Unicode Standard. Any
79 glyph with its code point listed in combining.txt will have zero width
80 in unifont.ttf.
81
83 Roman Czyborra, the font's creator, originally wrote two Perl scripts
84 as utilities: bdfimplode(1) and hexdraw(1).
85
86 The bdfimplode(1) Perl script reads in a font in BDF format and gener‐
87 ates a font output in unifont.hex format.
88
89 The hexdraw(1) Perl script might appear somewhat magical. It can read
90 a file in unifont.hex format and generate a text file with each glyph
91 appearing as a grid of characters in an 8 by 16 or 16 by 16 grid: a '-'
92 character indicates a corresponding white pixel, and a '#' character
93 indicates a corresponding black pixel. These pixel grids are indented
94 with a single tab character. The first line of each glyph first shows
95 the code point for the glyph, followed by a colon (':'). The 16 lines
96 that graphically represent each glyph are followed by one blank line.
97 This text file can then be modified with any text editor. The magical
98 part about hexdraw(1) is that it will read in this text file, detect
99 that it is in this converted format, and produce as output a second
100 file in Unifont's .hex format. Thus hexdraw(1) automagically provides
101 round-trip coverage between an original font file in unifont.hex format
102 and an intermediate text graphics format for editing.
103
104 Utilities introduced after those first two convert a file in uni‐
105 font.hex format to and from bitmapped graphics (".bmp") files. The
106 unihex2bmp(1) program converts a file in unifont.hex format into a .bmp
107 format file, for editing with a graphics editor. The unibmp2hex(1)
108 program performs the reverse conversion, from a bitmapped graphics for‐
109 mat back to a file in unifont.hex format.
110
111 hexdraw(1), unihex2bmp(1), and unibmp2hex(1) are the central programs
112 that handle conversion of a unifont.hex file to and from two-dimen‐
113 sional glyph representations for visual editing. See the doc/uni‐
114 font.info texinfo file included in the source package for more informa‐
115 tion on these and other utilities to customize unifont.hex format
116 files. Also consult the man pages for the utilities listed below.
117
119 The following files are part of the Unifont source distribution:
120
121 font/plane*/*.hex
122 GNU Unifont font files
123
124 LICENSE The Unifont license
125
126 README Instructions on building Unifont
127
128 doc/unifont.info
129 Tutorial in texinfo format on customizing Unifont
130
132 bdfimplode(1), hex2bdf(1), hex2sfd(1), hexbraille(1), hexdraw(1),
133 hexkinya(1), hexmerge(1), johab2ucs2(1), unibdf2hex(1), unibmp2hex(1),
134 unibmpbump(1), unicoverage(1), unidup(1), unifont-viewer(1), uni‐
135 font1per(1), unifontchojung(1), unifontksx(1), unifontpic(1), unigen‐
136 circles(1), unigenwidth(1), unihex2bmp(1), unihex2png(1), unihex‐
137 fill(1), unihexgen(1), unihexrotate(1), unipagecount(1), unipng2hex(1)
138
140 The unifont.hex format was created by Roman Czyborra, who drew the
141 original set of glyphs.
142
144 unifont is Copyright © 1998 Roman Czyborra, with portions Copyright ©
145 2007–2013 Paul Hardy, Copyright © 2004–2013 Qianqian Fang, and others.
146
147 This program is free software; you can redistribute it and/or modify it
148 under the terms of the GNU General Public License as published by the
149 Free Software Foundation; either version 2 of the License, or (at your
150 option) any later version.
151
153 The format is very straightforward and no real bugs exist. However,
154 Unifont's original BDF font format does not support Unicode's combining
155 characters (accents, etc.); only the TrueType version of Unifont does.
156
157
158
159 2020 Jul 03 UNIFONT(5)