use a custom console font

This commit is contained in:
Michael Hudson-Doyle 2018-06-26 10:54:00 +12:00
parent 891320d089
commit d6f634d646
5 changed files with 38 additions and 5 deletions

31
README.font.md Normal file
View File

@ -0,0 +1,31 @@
Subiquity comes with its own console font, which differs from the
standard one in how arrow-like glyphs are rendered; the standard font
renders them as arrowheaded forms like → but we want solid triangles
like ▶.
I built the font like this:
```
$ apt source console-setup
$ cd console-setup-*/Fonts
$ cat > my.equivalents <<EOF
U+2191 U+25B4 U+25B2
# U+2191: UPWARDS ARROW
# U+25B4: BLACK UP-POINTING SMALL TRIANGLE
# U+25B2: BLACK UP-POINTING TRIANGLE
U+2193 U+25BE U+25BC
# U+2193: DOWNWARDS ARROW
# U+25BE: BLACK DOWN-POINTING SMALL TRIANGLE
# U+25BC: BLACK DOWN-POINTING TRIANGLE
U+2190 U+25C2 U+25C0
# U+2190: LEFTWARDS ARROW
# U+25C2: BLACK LEFT-POINTING SMALL TRIANGLE
# U+25C0: BLACK LEFT-POINTING TRIANGLE
U+2192 U+25B8 U+25B6
# U+2192: RIGHTWARDS ARROW
# U+25B8: BLACK RIGHT-POINTING SMALL TRIANGLE
# U+25B6: BLACK RIGHT-POINTING TRIANGLE
EOF
$ ./bdf2psf --log ./my.log ./bdf/georgian16.bdf+./bdf/unifont.bdf+./bdf/h16.bdf+./bdf/etl16-unicode.bdf ./standard.equivalents+./my.equivalents ./ascii.set+./linux.set+./fontsets/Uni2.512+:./useful.set 512 ./subiquity.psf
```

View File

@ -1,7 +1,5 @@
#!/bin/sh
/bin/dmesg -n 1
loadkeys - <<EOF
string F91 = "\033[Z"
keycode 15 = Tab F91
EOF
$SNAP/usr/bin/subiquity-loadkeys
setfont $SNAP/subiquity.psf
/sbin/agetty -n --noclear -l $SNAP/usr/bin/python3 -o $SNAP/usr/bin/subiquity tty1 $TERM

View File

@ -71,6 +71,10 @@ parts:
/usr/share/console-setup/kbdnames-maker /usr/share/console-setup/KeyboardNames.pl > kbdnames.txt
stage:
- kbdnames.txt
font:
plugin: dump
stage:
- subiquity.psf
probert:
plugin: python
build-packages: [python-setuptools, libnl-3-dev, libnl-genl-3-dev, libnl-route-3-dev]

BIN
subiquity.psf Normal file

Binary file not shown.

View File

@ -205,7 +205,7 @@ class KeyboardModel:
with open(path, 'w') as fp:
fp.write(self.setting.render())
if self.root == '/':
run_command(['setupcon', '--save', '--force'])
run_command(['setupcon', '--save', '--force', '--keyboard-only'])
run_command(['/snap/bin/subiquity.subiquity-loadkeys'])
else:
run_command(['sleep', '1'])