Gentoo Archives: gentoo-user

From: Peter Humphrey <peter@××××××××××××.uk>
To: gentoo-user@l.g.o
Subject: [gentoo-user] Making a new frame-buffer console font
Date: Tue, 03 Feb 2015 14:43:41
Message-Id: 3944562.GxCy2uQorQ@wstn
1 Hello list,
2
3 This is to summarise what I did in case anyone else wants to do
4 something similar.
5
6 Last May I was looking for a font that would distinguish the upper-case
7 letter O from the numbers 0 and 8 on a virtual TTY with a frame-buffer.
8 My difficulty was twofold: the available unicode fonts were all too
9 small, and the only bigger fonts I could find had an oblique stroke
10 through the zero which made it look like an eight[1], and some of them
11 even had serifs.
12
13 The first step was to find a font that looked good. I chose terminus
14 font, which included fonts up to 32 pixels tall and had an attractive
15 and easily read shape to its characters.
16
17 The second step was to find a font editor, and I found nafe[2]. I
18 fetched it and compiled it locally. GCC threw out an error but the
19 program seemed to work anyway. I followed its readme.txt and used the
20 text editor joe to replace the oblique stroke in the zero with spaces,
21 and to round the shoulders; I made sure I kept the line lengths the
22 same, though it's supposed not to be necessary. Lastly I gzip'd the new
23 font file.
24
25 The shoulders could be made more rounded, but for the moment I'm happy
26 with the result I have.
27
28 Thirdly, working at a virtual console, I replaced the original
29 /usr/share/consolefonts/ter-v20n.psf.gz with my new version and called
30 "etc/init.d/consolefont restart". Lovely!
31
32 There was still a problem though: when I ran a kernel menuconfig the
33 line characters were displayed as question marks; the system log on VT12
34 couldn't display all the characters right either.
35
36 The reason was straightforward. I'd noticed that nafe used file-name
37 suffix .psfu for fonts with unicode maps and .psf for those without.
38 Since all the files in /usr/share/consolefonts had .psf I assumed they
39 didn't need the map. Wrong. So I added the unicode map into my new.ter-
40 v20n.psf to make new.ter-v20n.psfu, then gzip'd it and copied it back
41 into /usr/share/consolefonts as ter-v20n.psf.gz. (Notice the missing u.)
42 Now I get the expected display of kernel menuconfig and the VT12 log.
43
44 The final step was to add /usr/share/consolefonts to CONFIG_PROTECT in
45 /etc/portage/make.conf so that I wouldn't lose my changes at the next
46 upgrade.
47
48 I've attached my three new console fonts for anyone who'd like to use
49 them. I've settled on the 22-pixel version pro tem.
50
51 Thanks to David Haller for getting me started by pointing me in the
52 right direction.
53
54 1. Where did that oblique stroke come from? Was it just copied blindly
55 from those nasty old line printers, with their poor resolution? It must
56 surely be time now to get rid of it.
57
58 2. Not another font editor: http://sourceforge.net/projects/nafe/files/nafe/nafe-0.1/
59
60 --
61 Rgds
62 Peter.

Attachments

File name MIME type
new.ter-v20n.psfu application/octet-stream
new.ter-v22n.psfu application/octet-stream
new.ter-v24n.psfu application/octet-stream

Replies

Subject Author
Re: [gentoo-user] Making a new frame-buffer console font Walter Dnes <waltdnes@××××××××.org>