Sunday, November 11, 2018

Custom console fonts with wscons(4)

A very long time ago, I made a VGA or “console” font out of Leah Neukirchen’s font called “sq”. I even wrote a simple script which helped me do the conversion. The whole point of that exercise was to turn the “sq” font into a font for the console on my old NetBSD machine. I was successful all those years ago. But I couldn’t remember how I did it. So let me quickly show you what I had to do to get the font working on my current NetBSD box.

You could run several commands on the command line in order to achieve this effect, but it’s way simpler to simply edit wscons.conf(5) and restart the wscons system service.

First, towards the top of wscons.conf, we declare the existence of “sq” and the boldfaced version, “sqb”. It also ensures that the fonts will be loaded.

font  sq   - - iso /home/charlotte/fonts/sq.816
font  sqb  - - iso /home/charlotte/fonts/sqb.816

Then, towards the bottom of wscons.conf, we set the “font” variable for each tty to be “sq”.

setvar  ttyE0 font    sq
setvar  ttyE1 font    sq
setvar  ttyE2 font    sq
setvar  ttyE3 font    sq  

Then, we simply restart the wscons system service, and we’re all done!

charlotte@sakuracity:~$ sudo service wscons restart
wsconscfg: screen 1 is already configured
wsconscfg: screen 2 is already configured
wsconscfg: screen 3 is already configured
wsconscfg: screen 4 is already configured
Keyboard encoding -> us
ttyE0: font -> "sq"
ttyE1: font -> "sq"
ttyE2: font -> "sq"
ttyE3: font -> "sq"

No comments:

Post a Comment