You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

135 lines
9.1 KiB
HTML

<!doctype html>
<html lang=en>
<head id="head">
<meta charset=utf-8>
<title id=title >the codeartist — programmer and engineer based in BerlinUse OpenBSDs Spleen bitmap font in Linux</title>
<meta name=description content="The personal page and weblog of Norman Köhring">
<meta name=author content="Norman Köhring">
<meta name=DC.title content="the codeartist — programmer and engineer based in Berlin">
<meta name="twitter:card" content="summary">
<meta name="twitter:site" content="@koehr_in">
<meta name="twitter:author" content="@koehr_in">
<meta name=twitter:description content="The personal page and weblog of the codeartist Norman Köhring">
<meta name="twitter:title" content="Use OpenBSDs Spleen bitmap font in Linux // the codeartist">
<meta name="og:title" content="Use OpenBSDs Spleen bitmap font in Linux // the codeartist">
<meta property="og:type" content="website">
<meta http-equiv="x-ua-compatible" content="ie=edge"/>
<meta name=viewport content="width=device-width,initial-scale=1,shrink-to-fit=no"/>
<meta name=ICBM content="52.4595, 13.5335">
<meta name=geo.position content="52.4595; 13.5335">
<meta name=geo.region content=DE-BE>
<meta name=geo.placename content=Berlin>
<link rel=me href=https://koehr.in>
<link rel=me href=https://k0r.in>
<link rel=me href=https://koehr.ing>
<link rel=me href=@Koehr@mstdn.io>
<link rel=me href=https://sr.ht/~koehr/>
<link rel=me href=https://git.k0r.in>
<link rel=me href=https://threads.net/@coffee_n_code>
<link rel=me href=https://instagram.com/@coffee_n_code>
<link rel=me href=https://ko-fi.com/koehr>
<link rel=me href=https://reddit.com/user/koehr>
<link rel=icon href=/favicon.png type=image/x-icon>
<link rel=stylesheet href=/style.css>
</head>
<body>
<main id="main">
<header>
<h1 >Use OpenBSDs Spleen bitmap font in Linux</h1>
<em >Yesterday Frederic Cambus changed the default console font in OpenBSD to his self made font.</em>
<br/>
Last updated: <time datetime="Thu, 10 Jan 2019 00:00:00 +0000" >January 10, 2019</time>
</header>
<div ><p>The font is called <a href="https://github.com/fcambus/spleen">Spleen</a>, as mentioned in this <a href="https://undeadly.org/cgi?action=article;sid=20190110064857">BSD Journal article</a>.</p><p>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.</p><p>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".</p><p>If you managed to read this until this point, I congratulate you. You won a short list of commands:</p><pre><code class="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
</code></pre>
<p>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.</p></div>
</main>
<div id="spacer"></div>
<header id="header">
<a href="/">
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 832.4 143.1">
<path id="header-underscore"
d="M832.4 131.1q0 5.5-3.1 8.6-3 3.4-8.2 3.3h-75.5q-5.2 0-8.2-3.3-1.7-1.6-2.4-3.8-.7-2.3-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8-.7-2.3-.7-4.8V11.9q0-5.5 3-8.6 3-3.4 8.3-3.3 5.2 0 8.2 3.3 3.2 3.1 3.2 8.6v33q1.5-1 3-1.6l3.2-1.2 3.4-1q1.6-.5 3.3-.8l3.5-.4 3.6-.2q4.4 0 8.5 1 4.1.7 7.9 2.4 3.8 1.6 7.3 4.1 3.5 2.5 6.6 5.8Q484 66 484 84.8z" />
<path id="header-e"
d="M387.5 111.1q0 1.2-.3 2.3-.1 1-.5 2l-.9 2q-6.6 12-19.4 19-12 6.6-25.4 6.6-20.8 0-35.8-14.6-15.9-15-15.9-37 0-22.1 15.9-37.1 15-14.6 35.8-14.6 3.9 0 7.8.7 4 .7 8 2.2 9.2 3.1 18.2 10 6 4.6 9.1 9.3 3.3 4.7 3.3 10 0 1.3-.3 2.5-.2 1.3-.7 2.4-1.5 3.4-5 5.3l-56.9 32.2q7.2 4.9 16.5 4.9 7.2 0 12.6-2.5 5.5-2.5 9.7-7.4l.7-1 .8-1 .9-1.3 1-1.5q3.3-4.2 7.4-5.1l1.8-.2q4.4 0 8 3.4 3.6 3.5 3.6 8.5zm-29.9-42.7q-7.2-4.8-16.6-4.8-6 0-11 2-4.9 1.8-9.3 6-4.5 4-6.7 9-2 4.8-2 10.8l.1 2.9z" />
<path id="header-o"
d="M286.8 91.4q0 4.2-.6 8.3-.6 4-1.8 7.7-1.1 3.8-2.9 7.4-1.7 3.5-4 6.9-2.4 3.3-5.2 6.1Q258 143 237.7 143T203 128q-14.3-15.2-14.3-36.6 0-21.5 14.3-36.6 14.4-15 34.7-15 4 0 7.8.5 3.9.7 7.5 1.9t7 3q3.3 1.9 6.4 4.3 3.2 2.4 5.9 5.4 14.4 15 14.5 36.5zm-22.6 0q0-2.4-.4-4.5-.2-2.2-.9-4.2-.6-2-1.5-3.9-1-2-2.2-3.7-1.2-1.7-2.8-3.4-4-4.2-8.6-6.1-4.5-2-10-2-11 0-18.7 8.2-7.8 8-7.8 19.6 0 11.4 7.8 19.7 7.8 8 18.6 8 5.6 0 10.1-1.9 4.6-2 8.6-6.1 4-4.3 5.8-9 2-4.9 2-10.7z" />
<path id="header-k"
d="M186.3 131q0 4.7-3.3 8.3-1.5 1.8-3.7 2.7-2 1.1-4.3 1.1-3.5 0-6.6-2L119.2 105v26q0 5.5-3 8.6-3.1 3.4-8.4 3.3l-2.2-.2q-1-.1-2.2-.5-1-.3-2-1-1-.6-1.8-1.6-1.7-1.6-2.4-3.8-.7-2.3-.7-4.8V11.9q0-5.5 3-8.6 3-3.4 8.3-3.3 5.2 0 8.2 3.3 3.2 3.1 3.2 8.6v65.9l49.2-36.1q3.2-2 6.6-2 4.7 0 8 3.7t3.3 8.4q-.2 6-5 9.6l-41 30 41 29.9q2.3 1.7 3.6 4.2 1.4 2.5 1.4 5.4z" />
<path id="header-tilde"
d="M73.1 91q0 2-.6 3.9T71 98.6q-3.2 5.7-8.9 8.5-5.6 2.8-12.9 2.8-8.8 0-18-7.8-2.4-2.3-4.5-3.7-2.1-1.5-3-1.7-1.5 0-2.1.3l-.8 1.3q-.3.7-.8 1.2l-1 1-.9.8q-2.7 2-6.4 2-1.7 0-3.2-.3-1.4-.3-3-1.1-1.5-.8-2.6-2.1-2.8-3.1-2.8-8v-1.3q0-.7.2-1.2l.2-1 .4-1 .4-1q.1-.6.5-1.1l.5-1q3.2-5.7 8.8-8.5 5.7-2.9 13-2.9 3.2 0 6.2 1 3 .9 6 2.7 2.9 1.6 5.7 4.2 5.2 4.6 7.6 5.4 1 0 1.6-.2l.7-.4q.3-.1.5-.4 3.6-5.6 9.2-5.6 5.7 0 8.8 3.5 2.8 3 2.8 8z" />
</svg>
Homepage of
<div class=p-name>
<span class=first-name>Norman</span>
<span class=last-name>Köhring</span>
</div>
Code Artist
</a>
</header>
<div id="main-menu">
<menu>
<li><a title="What I do these days" href="/now">/now</a></li>
<li><a title="Today I Learned" href="/til">/til</a></li>
<li><a title="My projects" href="/projects">/projects</a></li>
<li><a title="Weblog" href="/blog">/blog</a></li>
<li><a title="CV / Resume" href="/cv">/cv</a></li>
<li><a title="Tools I use" href="/stack">/stack</a></li>
<li><a title="Hardware I use" href="/setup">/setup</a></li>
<li><a title="Shared Bookmarks" href="/bookmarks">/links</a></li>
</menu>
</div>
<footer id="footer">
</footer>
<script defer>
const el = document.getElementById('header')
const threshhold = 24
let headerIsSmall = false
window.addEventListener("scroll", () => {
if (window.scrollY > threshhold && !headerIsSmall) {
el.classList.add('small')
headerIsSmall = true
} else if (window.scrollY <= threshhold && headerIsSmall) {
el.classList.remove('small')
headerIsSmall = false
}
})
</script>
<script async data-goatcounter=https://koehr.goatcounter.com/count src=//gc.zgo.at/count.js></script>
</body>
</html>