unifont-7.0.06.tar.gz
[unifont.git] / man / unifont.5
1 .TH UNIFONT 5 "2013 Sep 27"
2 .SH NAME
3 Unifont \- A bitmapped font with full Unicode Plane 0 (BMP) coverage
4 .SH SYNOPSIS
5 .br
6 .B unifont.hex
7 .SH DESCRIPTION
8 .B Unifont
9 is a bitmapped font with glyphs described in a plain text file, generically
10 referred to as
11 .B unifont.hex
12 herein.
13 This man page describes the format of three related files:
14 .B unifont.hex, masks.hex,
15 and
16 .B combining.txt.
17 All three of these files start with a Unicode code point as a hexadecimal
18 string, with code points appearing in ascending order.
19 .PP
20 A
21 .B unifont.hex
22 file consists of single-line entries for each Unicode code point.
23 Each line contains the code point, a colon (':') field separator,
24 and the glyph bitmap.
25 .B The glyphs in a unifont.hex format file must appear in ascending
26 .B Unicode code point order.
27 .PP
28 This file can be converted into a BDF font using the
29 .B hex2bdf (1)
30 program, and into a TrueType font using
31 .B fontforge (1)
32 (which is not part of this package).
33 The BDF font can also be converted into a PCF font using
34 .B bdftopcf (1)
35 (which is also not part of this package).
36 .PP
37 .B The first field
38 .RS
39 The first field is the Unicode code point in hexadecimal, ranging from
40 "0000" through "FFFF", inclusive.  This corresponds to the Unicode
41 code points U+0000 through U+FFFF, respectively.
42 .RE
43 .PP
44 .B The second field
45 .RS
46 The second field is the glyph's bitmap string.  This is a series of
47 hexadecimal digits.  Currently Unifont encodes two glyph sizes:
48 8 pixels wide by 16 pixels tall (single-width), and
49 16 pixels wide by 16 pixels tall (double-width).
50 .LP
51 As each hexadecimal digit can encode four bits, one pixel row of a glyph
52 is either two hexadecimal digits long (single-width) or four hexadecimal
53 digits long (double-width).  The glyphs are 16 pixels tall, so
54 a single-width glyph is (2)(16) = 32 hexadecimal digits long and
55 a double-width glyph is (4)(16) = 64 hexadecimal digits long.
56 .RE
57 .PP
58 Previous versions of this package supplied a file named
59 .B masks.hex.
60 This file followed the same format as
61 .B unifont.hex
62 with a first field that was a Unicode code point in hexadecimal,
63 followed by a colon (':') field separator,
64 followed by a second field that was a hexadecimal string representing
65 a glyph bitmap.  Code points were in ascending order.  The glyph bitmaps
66 were bitmaps that would be exclusive-ored with the glyph in
67 .B unifont.hex
68 that had the same code point.
69 The original
70 .B unifont.hex
71 contained combining circles as depicted in
72 .I The Unicode Standard.
73 When Paul Hardy got combining characters to display properly in the
74 TrueType version, it became desirable to remove these combining circles
75 for proper display with
76 .B unifont.ttf.
77 The program
78 .B uniunmask (1)
79 will read such a
80 .B masks.hex
81 file, read a
82 .B unifont.hex
83 format file, and apply the exclusive-or masks in
84 .B masks.hex
85 to
86 .B unifont.hex.
87 The output is another file in
88 .B unifont.hex
89 format with the masked-off bits (i.e., combining circles) removed.
90 .PP
91 Because the operation is an exclusive-or,
92 .B masks.hex
93 could also be used to turn on pixels in selective glyphs, for exmaple
94 to add combining circles to selective glyphs that do not show them.
95 However, the program
96 .B unigencircles (1)
97 can do this without a separate
98 .B masks.hex
99 file.  Thus
100 .B masks.hex
101 is no longer supplied with this package.
102 .B uniunmask (1)
103 remains part of this distribution in case someone might find creating a custom
104 .B masks.hex
105 file useful for another purpose.
106 .PP
107 The TrueType version of the font,
108 .B unifont.ttf,
109 and the
110 .B unigencircles (1)
111 utility both read a file
112 .B combining.txt.
113 This file appears in the directory
114 .B font/ttfsrc.
115 The
116 .B combining.txt
117 file is a list of code points as hexadecimal strings, one per line in
118 ascending order, of Unicode code points that show combining circles in
119 .I The Unicode Standard.
120 Any glyph with its code point listed in
121 .B combining.txt
122 will have zero width in
123 .B unifont.ttf.
124 .SH UTILITIES
125 Roman Czyborra, the font's creator, originally wrote two Perl scripts
126 as utilities:
127 .B bdfimplode (1)
128 and
129 .B hexdraw (1).
130 .PP
131 The
132 .B bdfimplode (1)
133 Perl script reads in a font in BDF format and generates a font output in
134 .B unifont.hex
135 format.
136 .PP
137 The
138 .B hexdraw (1)
139 Perl script might appear somewhat magical.  It can read a file in
140 .B unifont.hex
141 format and generate a text file with each glyph appearing
142 as a grid of characters in an 8 by 16 or 16 by 16 grid:
143 a '-' character indicates a corresponding white pixel, and
144 a '#' character indicates a corresponding black pixel.  These pixel grids
145 are indented.  The first line shows the code point for a glyph, followed
146 by a colon (':').  This text file can then be modified with any text
147 editor.  The magical part about
148 .B hexdraw (1)
149 is that it will read in
150 this text file, detect that it is in this converted format, and produce
151 as output a second file in Unifont's .hex format.  Thus
152 .B hexdraw (1)
153 automagically provides round-trip coverage between an original font file in
154 .B unifont.hex
155 format and an intermediate text graphics format for editing.
156 .PP
157 Utilities introduced after those first two convert a file in
158 .B unifont.hex
159 format to and from bitmapped
160 graphics (".bmp") files.  The
161 .B unihex2bmp (1)
162 program converts a file in
163 .B unifont.hex
164 format into a .bmp format file,
165 for editing with a graphics editor.  The
166 .B unibmp2hex (1)
167 program performs the reverse conversion, from a bitmapped graphics format
168 back to a file in
169 .B unifont.hex
170 format.
171 .PP
172 .B hexdraw (1), unihex2bmp (1),
173 and
174 .B unibmp2hex (1)
175 are the central programs that handle conversion of a
176 .B unifont.hex
177 file to and from two-dimensional glyph representations for visual editing.
178 See the
179 .B TUTORIAL
180 file included in the source pakcage for more information on these and
181 other utilities to customize
182 .B unifont.hex
183 format files.  Also consult the man pages for the utilities listed below.
184 .SH FILES
185 The following files are part of the Unifont source distribution:
186 .TP 15
187 .B font/plane00/*.hex
188 GNU Unifont font files
189 .TP 15
190 .B LICENSE
191 The Unifont license
192 .TP 15
193 .B README
194 Instructions on building Unifont
195 .TP 15
196 .B TUTORIAL
197 Tutorial on customizing Unifont
198 .SH SEE ALSO
199 .BR bdfimplode(1),
200 .BR hex2bdf(1),
201 .BR hex2sfd(1),
202 .BR hexbraille(1),
203 .BR hexdraw(1),
204 .BR hexkinya(1),
205 .BR hexmerge(1),
206 .BR johab2ucs2(1),
207 .BR unibdf2hex(1),
208 .BR unibmp2hex(1),
209 .BR unicoverage(1),
210 .BR unidup(1),
211 .BR unifont-viewer(1),
212 .BR unifontchojung(1),
213 .BR unifontksx(1),
214 .BR unifontpic(1),
215 .BR unigencircles(1),
216 .BR unigenwidth(1),
217 .BR unihex2bmp(1),
218 .BR unihex2png(1),
219 .BR unihexfill(1),
220 .BR unihexgen(1),
221 .BR unipagecount(1),
222 .BR unipng2hex(1)
223 .SH AUTHOR
224 The
225 .B unifont.hex
226 format was created by Roman Czyborra, who drew the original set of glyphs.
227 .SH LICENSE
228 .B unifont
229 is Copyright \(co 1998 Roman Czyborra, with portions Copyright \(co 2007-2013
230 Paul Hardy, Copyright \(co 2004-2013 Qianqian Fang, and others.
231 .PP
232 This program is free software; you can redistribute it and/or modify
233 it under the terms of the GNU General Public License as published by
234 the Free Software Foundation; either version 2 of the License, or
235 (at your option) any later version.
236 .SH BUGS
237 The format is very straihtforward and no real bugs exist.  However,
238 Unifont's original BDF font format does not support Unicode's combining
239 characters (accents, etc.); only the TrueType version of Unifont does.