Add Linux console font

A console font with braille and graphic block characters is needed to
run gotop directly on the Linux console. Contribute a 16x8 psf font
containing these characters.

Signed-off-by: Claudio Matsuoka <cmatsuoka@gmail.com>
This commit is contained in:
Claudio Matsuoka 2019-04-07 15:07:53 -03:00
parent a31e182925
commit 3818e459fa
4 changed files with 4914 additions and 0 deletions

Binary file not shown.

16
fonts/README Normal file
View File

@ -0,0 +1,16 @@
`Lat15-VGA16-braille.psf` is a Linux console font based on `Lat15-VGA16.psf`
with additional braille and graphic block characters suitable to run gotop
on the Linux console without a graphic environment. To use the braille font,
just run `setfont Lat15-VGA16-braille.psf`.
To rebase the braille and graphic block characters on a different 16x8
psf font, use the psf2txt and txt2psf from psftools[1]. In this case, make
sure the `Length:` entry in the file header is set to 512.
The original `Lat15-VGA16.psf` font file was obtained from the Ubuntu 18.04
console-setup-linux package[2]. Console fonts are public domain by nature[3].
[1] https://www.seasip.info/Unix/PSF/
[2] https://launchpad.net/ubuntu/bionic/amd64/console-setup-linux/1.178ubuntu2.7
[3] https://launchpad.net/ubuntu/bionic/+source/console-setup/+copyright

4864
fonts/braille.txt Normal file

File diff suppressed because it is too large Load Diff

34
fonts/gen-braille.py Normal file
View File

@ -0,0 +1,34 @@
#!/usr/bin/python3
def show_char(i):
bit = [ '--', '--', '--', '--', '--', '--', '--', '--' ]
for n in range(0, 8):
if i & (1 << n):
bit[n] = '##'
print('%')
print('// Character {}'.format(256+i))
print('Bitmap: -------- \\')
print(' -{}--{}- \\'.format(bit[0], bit[3]))
print(' -{}--{}- \\'.format(bit[0], bit[3]))
print(' -------- \\')
print(' -------- \\')
print(' -{}--{}- \\'.format(bit[1], bit[4]))
print(' -{}--{}- \\'.format(bit[1], bit[4]))
print(' -------- \\')
print(' -------- \\')
print(' -{}--{}- \\'.format(bit[2], bit[5]))
print(' -{}--{}- \\'.format(bit[2], bit[5]))
print(' -------- \\')
print(' -------- \\')
print(' -{}--{}- \\'.format(bit[6], bit[7]))
print(' -{}--{}- \\'.format(bit[6], bit[7]))
print(' --------')
print('Unicode: [{:08x}];'.format(0x2800 + i))
if __name__ == '__main__':
for i in range(0, 256):
show_char(i)