UNIFONT(5)
β¨ UNIFONT(5) β¨
okay bestie, sit down, because we're about to talk about the Unifont file format π this is a page from the File Formats Manual, and it's literally the blueprint for a bitmapped font that has full Unicode Plane 0 (BMP) coverage. yes. all of it. no cap.
πΈ NAME πΈ
Unifont β a bitmapped font with full Unicode Plane 0 (BMP) coverage π¦
π SYNOPSIS π
unifont.hex
π DESCRIPTION π
Unifont is a bitmapped font where the glyphs live in a plain text file, which we generically call unifont.hex around here. This man page is gonna walk you through the format of three related files: unifont.hex, masks.hex, and combining.txt. All three of them start with a Unicode code point written as a hexadecimal string, and the code points show up in ascending order. periodt.
A unifont.hex file is made of single-line entries, one for each Unicode code point. Every line has the code point, a colon (':') as the field separator, and then the glyph bitmap. And the glyphs in a unifont.hex format file must appear in ascending Unicode code point order β don't be chaotic, bestie π
You can turn this file into a BDF font using hex2bdf(1), and into a TrueType font using fontforge(1) (which is not part of this package, fyi). The BDF font can also become a PCF font using bdftopcf(1) (also not part of this package β she's a guest star β¨).
π The first field
The first field is the Unicode code point in hexadecimal, ranging from "0000" through "10FFFF", inclusive. That maps to the Unicode code points U+0000 through U+10FFFF, respectively. math is mathing π―
π¦ The second field
The second field is the glyph's bitmap string β a whole series of hexadecimal digits. Right now Unifont encodes two glyph sizes: 8 pixels wide by 16 pixels tall (single-width), and 16 pixels wide by 16 pixels tall (double-width). There's also a third format, 32 pixels wide (drawn as 31 pixels plus a pixel on the right that is always blank) by 16 pixels tall (quadruple-width) β but that one is only for experimental use, so don't get too attached π«Ά
Since each hexadecimal digit encodes four bits, one pixel row of a glyph is either two hexadecimal digits long (single-width) or four hexadecimal digits long (double-width). The glyphs are 16 pixels tall, so:
- a single-width glyph is (2)(16) = 32 hexadecimal digits long
- a double-width glyph is (4)(16) = 64 hexadecimal digits long
π Previous versions of this package supplied a file named masks.hex
That file followed the same format as unifont.hex: a first field that was a Unicode code point in hexadecimal, then a colon (':') field separator, then a second field that was a hexadecimal string representing a glyph bitmap. Code points were in ascending order. The glyph bitmaps were bitmaps that would be exclusive-ored with the glyph in unifont.hex that had the same code point. The original unifont.hex contained combining circles as depicted in The Unicode Standard. When Paul Hardy got combining characters to display properly in the TrueType version, it became desirable to remove these combining circles for proper display with unifont.ttf. The program uniunmask(1) will read such a masks.hex file, read a unifont.hex format file, and apply the exclusive-or masks in masks.hex to unifont.hex. The output is another file in unifont.hex format with the masked-off bits (i.e., combining circles) removed. slay π
Because the operation is an exclusive-or, masks.hex could also be used to turn on pixels in selective glyphs β for example, to add combining circles to selective glyphs that do not show them. However, the program unigencircles(1) can do this without a separate masks.hex file. So masks.hex is no longer supplied with this package. uniunmask(1) remains part of this distribution in case someone might find creating a custom masks.hex file useful for another purpose. (no thoughts, just archival energy ποΈ)
The TrueType version of the font, unifont.ttf, and the unigencircles(1) utility both read a file combining.txt. This file appears in the directory font/ttfsrc. The combining.txt file is a list of code points as hexadecimal strings, one per line in ascending order, of Unicode code points that show combining circles in The Unicode Standard. Any glyph with its code point listed in combining.txt will have zero width in unifont.ttf. iconic behavior honestly π
π₯ UTILITIES π₯
Roman Czyborra, the font's creator, originally wrote two Perl scripts as utilities: bdfimplode(1) and hexdraw(1). the founding mothers of this whole operation fr fr
- The
bdfimplode(1)Perl script reads in a font in BDF format and generates a font output inunifont.hexformat. - The
hexdraw(1)Perl script might appear somewhat magical β¨ It can read a file inunifont.hexformat and generate a text file with each glyph appearing as a grid of characters in an 8 by 16 or 16 by 16 grid: a'-'character indicates a corresponding white pixel, and a'#'character indicates a corresponding black pixel. These pixel grids are indented with a single tab character. The first line of each glyph first shows the code point for the glyph, followed by a colon (':'). The 16 lines that graphically represent each glyph are followed by one blank line. This text file can then be modified with any text editor. The magical part abouthexdraw(1)is that it will read in this text file, detect that it is in this converted format, and produce as output a second file in Unifont's.hexformat. Thushexdraw(1)automagically provides round-trip coverage between an original font file inunifont.hexformat and an intermediate text graphics format for editing. she's giving round-trip realness π§
Utilities introduced after those first two convert a file in unifont.hex format to and from bitmapped graphics (".bmp") files:
- The
unihex2bmp(1)program converts a file inunifont.hexformat into a.bmpformat file, for editing with a graphics editor. - The
unibmp2hex(1)program performs the reverse conversion, from a bitmapped graphics format back to a file inunifont.hexformat.
hexdraw(1), unihex2bmp(1), and unibmp2hex(1) are the central programs that handle conversion of a unifont.hex file to and from two-dimensional glyph representations for visual editing. See the doc/unifont.info texinfo file included in the source package for more information on these and other utilities to customize unifont.hex format files. Also consult the man pages for the utilities listed below. π
π FILES π
The following files are part of the Unifont source distribution:
font/plane*/*.hexβ GNU Unifont font filesLICENSEβ The Unifont licenseREADMEβ Instructions on building Unifontdoc/unifont.infoβ Tutorial in texinfo format on customizing Unifont
β SEE ALSO β
bdfimplode(1), hex2bdf(1), hex2otf(1), hex2sfd(1), hexbraille(1), hexdraw(1), hexkinya(1), hexmerge(1), johab2syllables(1), johab2ucs2(1), unibdf2hex(1), unibmp2hex(1), unibmpbump(1), unicoverage(1), unidup(1), unifont-johab631(5), unifont-viewer(1), unifont1per(1), unifontchojung(1), unifontksx(1), unifontpic(1), unigen-hangul(1), unigencircles(1), unigenwidth(1), unihex2bmp(1), unihex2png(1), unihexfill(1), unihexgen(1), unihexpose(1), unihexrotate(1), unijohab2html(1), unipagecount(1), unipng2hex(1)
(that's the whole squad π«Ά go read them, iykyk)
π AUTHOR π
The unifont.hex format was created by Roman Czyborra, who drew the original set of glyphs. legend behavior, honestly.
π LICENSE π
unifont is Copyright Β© 1998 Roman Czyborra, with portions Copyright Β© 2007β2013 Paul Hardy, Copyright Β© 2004β2013 Qianqian Fang, and others.
This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version.
π BUGS π
The format is very straightforward and no real bugs exist. (not me being shocked π)
However, Unifont's original BDF font format does not support Unicode's combining characters (accents, etc.); only the TrueType version of Unifont does. so like, know that before you come for her π
and that's the whole page, bestie!! πβ¨ this was UNIFONT(5) from the File Formats Manual, dated 2020 Jul 03 β thank u for coming to my ted talk, go forth and hex π¦π
π¦ where this page comes from
- alpine 3.22: unifont-doc 16.0.03-r0 Β· GFDL-1.3-or-later GPL-2.0-or-later WITH Font-exception-2.0
- alpine 3.23: unifont-doc 17.0.03-r0 Β· GFDL-1.3-or-later GPL-2.0-or-later WITH Font-exception-2.0
- alpine 3.24: unifont-doc 17.0.04-r0 Β· GFDL-1.3-or-later GPL-2.0-or-later WITH Font-exception-2.0
- debian trixie: unifont-bin 1:15.1.01-1 Β· GPL-2.0-or-later
- fedora 43: unifont 16.0.01-6.fc43 Β· GPL-2.0-or-later AND OFL-1.1 AND GFDL-1.3-or-later
- fedora 44: unifont 16.0.01-7.fc44 Β· GPL-2.0-or-later AND OFL-1.1 AND GFDL-1.3-or-later
- nixpkgs unstable: unifont 18.0.01
- ubuntu noble: unifont-bin 1:15.1.01-1build1 Β· GPL-2.0-or-later
- ubuntu questing: unifont-bin 1:16.0.04-1
- ubuntu resolute: unifont-bin 1:16.0.04-1build1 Β· GPL-2.0-or-later
- ubuntu stonking: unifont-bin 1:16.0.04-1build1 Β· GPL-2.0-or-later
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms