41 lines
2.4 KiB
Text
41 lines
2.4 KiB
Text
---
|
|
{
|
|
.title = "Use OpenBSDs Spleen bitmap font in Linux",
|
|
.date = @date("2019-01-10T00:00:00"),
|
|
.author = "koehr",
|
|
.draft = false,
|
|
.layout = "blog.shtml",
|
|
.description = "Yesterday Frederic Cambus changed the default console font in OpenBSD to his self made font.",
|
|
.tags = [],
|
|
}
|
|
---
|
|
The font is called [Spleen](https://github.com/fcambus/spleen), as mentioned in this [BSD Journal article](https://undeadly.org/cgi?action=article;sid=20190110064857).
|
|
|
|
To be totally honest, I stopped thinking about TTY (aka console) fonts a long time ago. It just happened to get interesting again when I got a HiRes screen and suddenly a magnifying glass was necessary to read the TTY. Yes I am one of those people who still deny the existence of graphical installers. If you want to change my mind, feel free to write me.
|
|
|
|
Anyhow, I figured that Spleen is pretty and useful because it offers glyphs with sizes up to 32x64. Typical fonts in Void Linux are 8x16 or similar, which is very small on high DPI screens. But how to use them? Spleen comes in strange formats like <span title="Glyph Bitmap Distribution Format">BDF</span> or <span title="thats a Macintosh thing">.dfont</span> but we need another strange format called <span title="Linux PC Screen Font Data with unicode directory">PSFU</span>. If we look at the description that comes with Spleen we only get tought how to make yet another strange format called <span title="Portable Compiled Format">PCF</span>. Puh, so confusing. Fonts must have been a real pain back in the "good old times".
|
|
|
|
If you managed to read this until this point, I congratulate you. You won a short list of commands:
|
|
|
|
```sh
|
|
# assuming bdf2psf is installed
|
|
FONTDIR=/usr/share/kbd/consolefonts # or anything you want
|
|
SPLEENDIR=$HOME/src/spleen # or whereever you want the repo
|
|
EQUIV=/usr/share/bdf2psf/standard.equivalents # check bdf2psf manpage
|
|
FONTSET=/usr/share/bdf2psf/fontsets/Uni1.512 # check bdf2psf manpage
|
|
|
|
git clone https://github.com/fcambus/spleen.git $SPLEENDIR
|
|
|
|
for x in 12x24 16x32 32x64 5x8 8x16 # do it for all available sizes
|
|
do
|
|
bdf2psf --fb \
|
|
${SPLEENDIR}/spleen-${x}.bdf \
|
|
$EQUIV $FONTSET 512 \
|
|
${FONTDIR}/spleen-${x}.psfu
|
|
done
|
|
|
|
# assuming you're in the TTY
|
|
setfont ${SPLEENDIR}/spleen-16x32.psfu
|
|
```
|
|
|
|
That worked for me! Except spleen-32x64 didn't work for me. It might be too big for Linux TTYs but would be too big anyways. Lets wait for 8K displays.
|