Change framebuffer terminal font
This commit is contained in:
42
toolchain/build-uni_vga.sh
Executable file
42
toolchain/build-uni_vga.sh
Executable file
@@ -0,0 +1,42 @@
|
||||
#!/bin/sh -e
|
||||
|
||||
mkdir -p /opt/external && cd /opt/external
|
||||
[ -f "uni-vga.tgz" ] || wget "https://www.inp.nsk.su/~bolkhov/files/fonts/univga/uni-vga.tgz"
|
||||
[ -d "uni_vga" ] || tar -xf uni-vga.tgz
|
||||
|
||||
cd uni_vga
|
||||
python3 - << EOF
|
||||
|
||||
codepoint = 0
|
||||
reading = False
|
||||
|
||||
chars = {}
|
||||
|
||||
with open("u_vga16.bdf") as fp:
|
||||
while line := fp.readline():
|
||||
|
||||
if line.startswith("ENCODING"):
|
||||
codepoint = int(line.split()[1])
|
||||
continue
|
||||
|
||||
if line.startswith("BITMAP"):
|
||||
values = []
|
||||
while True:
|
||||
line = fp.readline()
|
||||
if line.startswith("ENDCHAR"):
|
||||
break
|
||||
values.append(int(line, 16))
|
||||
chars[codepoint] = values
|
||||
|
||||
with open("u_vga16.termfont.inc", "w") as fp:
|
||||
fp.write("// THIS FILE IS GENERATED BY toolchain/build-univga-font.sh\n")
|
||||
fp.write(f"unsigned char font[{127-32}][16] =")
|
||||
fp.write("{\n")
|
||||
|
||||
for codepoint in range(32, 127):
|
||||
fp.write("\t{" + ", ".join([f"0x{v:02X}" for v in chars.get(codepoint, [])]) + "},\n")
|
||||
|
||||
fp.write("};")
|
||||
EOF
|
||||
|
||||
cp u_vga16.termfont.inc ${BUILDROOT}/src/libmittos/graphics/.
|
||||
Reference in New Issue
Block a user