BDF2PSF(1)
β¨ BDF2PSF(1) β¨
okay bestie, sit down, hydrate, because we're about to talk about the console-setup User's Manual page for bdf2psf and it's actually so good π
πΈ NAME πΈ
bdf2psf β the lil icon that converts a BDF font into PSF format for the Linux console π
π¦ SYNOPSIS π¦
bdf2psf [--fb] [--log logfile] bdf{+bdf} equivalence{+equivalence}
symbols{+[:]symbols} size psf [sfm]
π DESCRIPTION π
so bdf2psf translates BDF fonts into PSF format, periodt. it's not picky either β it accepts fonts with an arbitrary size of the font matrix, which is giving flexible queen energy π
and here's the little glow-up moment: if the width of the glyph matrix of the source font is 7 or 9 pixels, it generates fonts with a width of 8 pixels. math! slay! β¨
π OPTIONS π
--fbβ generate the font for framebuffer. and bestie, there are two important differences between the framebuffer and text mode, so listen up:- every font in text mode has to have a matrix
8pixels wide, and they also have to have either256or512glyphs. - in most text modes the hardware does some little magic trick to use
8pixel width fonts as if they were9pixels width. to pull this off, the video hardware copies the8thcolumn into the9thcolumn of the glyphs with codes from0xC0to0xDFand from0x1C0to0x1DF. and becausebdf2psfis very careful when deciding where to place a particular glyph, the encoding of the generated font ends up being more or less arbitrary π
- every font in text mode has to have a matrix
--loglogfile β record any problems during the conversion in the file logfile. it's the receipts file, fr fr πbdf{+bdf}β the+-separated list of the source BDF font(s). when a particular symbol is defined in more than one of the specified fonts, the fonts listed first take precedence π (first come, first served, no cap)equivalence{+equivalence}β a+-separated list of files defining an equivalence relation between the glyphs. go read the EQUIVALENCE FILES section below, it's right there πsymbols{+[:]symbols}β a+-separated list of files describing character sets. the generated font will support all specified character sets. when there's no space in the PSF font for all symbols, the character sets listed first take precedence. and when you put a colon before a character set, no warnings will be issued for symbols that could not be placed in the font. (colon = quiet mode, iykyk). see the CHARACTER SETS section below πsizeβ the size of the PSF font. usually256or512glyphs.psfβ the name of the generated font. and heads up: if a file with this name already exists, it will be overwritten π so double-check before you commit, bestiesfmβ save the SFM of the generated font in the file sfm. this parameter is optional π«Ά
π§ CHARACTER SETS π§
the encodings of the traditional console fonts are similar to the standard encodings of the different languages. for example there are fonts for all variants of ISO 8859. and honestly? it's redundant. like, ISO 8859-1, ISO 8859-9 and ISO 8859-15 differ only by a few characters and can be easily covered by only one font. the way that they overlap... it's giving minimal effort, maximum coverage β¨
so to determine the minimal set of character sets, a clustering algorithm was used. the source code of fontconfig contains lists of the characters that most languages require β one list per language. they started with one character set per language and used the clustering algorithm to join the character sets into bigger ones. the character sets described in files installed in the directory fontsets were the result of the algorithm. these files list the unicodes of the symbols of the character set, one per line. comments starting with a sharp sign are also allowed π
the files ascii.set, linux.set, freebsd.set and useful.set contain four special character sets. the first lists the ASCII symbols, and the second and third list the symbols from the so called alternate character set (see section "Line Graphics" of terminfo(5)) β one for Linux and one for FreeBSD. notice that in order to limit itself to the cp437 character set, the Linux console driver does some approximations of the symbols from the alternate character set. for example it prints U+256A (BOX DRAWINGS VERTICAL SINGLE AND HORIZONTAL DOUBLE) instead of the not-equal sign. the file linux.set lists the symbols used by the Linux console driver (i.e. U+256A instead of the not-equal sign). the symbols from freebsd.set are not fixed by the FreeBSD kernel, but there too there are some approximations. approximations everywhere, we love a workaround π
in most cases there's more available space in the fonts than necessary. the spare codes can be filled with the symbols from the useful.set special character set. and it's convenient to use a colon before the name of useful.set on the command line of bdf2psf, so no warnings are issued when there's no space in the font for some of these symbols π (that colon again, iconic behaviour)
π¦ EQUIVALENCE FILES π¦
the equivalence files define an equivalence relation between unicodes. the sharp sign is used for comments, and the empty lines are ignored. all other lines should list two or more unicodes. only one glyph will be allocated in the PSF font for these unicodes. so basically: "these ones look the same, one glyph is enough" π
example:
U+2126 U+03A9
# U+2126: OHM SIGN
# U+03A9: GREEK CAPITAL LETTER OMEGA
U+041D U+0048
# U+041D: CYRILLIC CAPITAL LETTER EN
# U+0048: LATIN CAPITAL LETTER H
this equivalence file says that U+2126 (the Ohm sign) and U+03A9 (Omega) have the same look so only one glyph is enough for them. and also U+041D (Cyrillic En) and U+0048 (Latin H) look the same. twins! π«Ά
two equivalence files are provided β standard.equivalents and arabic.equivalents. the first one can be used for all fonts. the purpose of the second is to reduce the number of the necessary glyphs for the Arabic letters at the cost of the font quality. it should be used only for fonts that have to support Arabic but there is not enough space in the PSF font for all Arabic characters. and btw the Uni1 character set is a character set that requires arabic.equivalents. noted π
π FILES π
all mentioned files and directories are usually installed in /usr/share/bdf2psf or /usr/local/share/bdf2psf π
π AUTHOR π
Anton Zinoviev <anton@lml.bas.bg> β thank you for your service, king π
and that's the whole page bestie!! this came from console-setup, dated 2006-01-16 πΈ go forth and convert your fonts, you've got this πβ¨π¦
π¦ where this page comes from
- centos-stream 9: console-setup 1.200-4.el9 Β· GPLv2+ and MIT and Public Domain
- debian bookworm: bdf2psf 1.221
- debian trixie: bdf2psf 1.242~deb13u1
- fedora 43: bdf2psf 1.239-2.fc43 Β· GPL-2.0-or-later AND MIT AND LicenseRef-Fedora-Public-Domain
- fedora 43: console-setup 1.239-2.fc43 Β· GPL-2.0-or-later AND MIT AND LicenseRef-Fedora-Public-Domain
- fedora 44: bdf2psf 1.245-3.fc44 Β· GPL-2.0-or-later AND MIT AND LicenseRef-Fedora-Public-Domain
- fedora 44: console-setup 1.245-3.fc44 Β· GPL-2.0-or-later AND MIT AND LicenseRef-Fedora-Public-Domain
- nixos 26.05: bdf2psf 1.248
- nixpkgs unstable: bdf2psf 1.249
- opensuse-leap 16.0: bdf2psf 1.223-160000.2.2 Β· GPL-2.0-or-later AND MIT AND SUSE-Public-Domain
- ubuntu jammy: bdf2psf 1.205ubuntu3
- ubuntu noble: bdf2psf 1.226ubuntu1
- ubuntu noble: bdf2psf 1.226ubuntu1.1
- ubuntu questing: bdf2psf 1.237ubuntu1
- ubuntu resolute: bdf2psf 1.237ubuntu3
- ubuntu resolute: bdf2psf 1.237ubuntu3.1
- ubuntu stonking: bdf2psf 1.248ubuntu3
- Copyright (C) 2007, 2011 Anton Zinoviev <anton@lml.bas.bg>
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms