Progress on dina-psf

This commit is contained in:
Jan-Bulthuis 2025-02-11 23:01:54 +01:00
parent fc5429a981
commit 5995d1ea37
1 changed files with 36 additions and 6 deletions

View File

@ -12,8 +12,9 @@ pkgs.stdenv.mkDerivation {
''; '';
buildInputs = with pkgs; [ buildInputs = with pkgs; [
dina-font
bdf2psf bdf2psf
fontforge
kbd
]; ];
buildPhase = '' buildPhase = ''
@ -22,16 +23,45 @@ pkgs.stdenv.mkDerivation {
# Set the AVERAGE_WIDTH property on the font # Set the AVERAGE_WIDTH property on the font
sed 's/STARTPROPERTIES 16/STARTPROPERTIES 17\ sed 's/STARTPROPERTIES 16/STARTPROPERTIES 17\
AVERAGE_WIDTH 70/' ./dina.bdf > ./dina-mod.bdf AVERAGE_WIDTH 70/' ./dina.bdf > ./dina-enc.bdf
# # Reencode the font from code page CP1252 (Windows) to unicode
# fontforge -lang=ff -c "Open(\"dina-mod.bdf\"); Reencode(\"win\", 1); Reencode(\"iso10646-1\"); Generate(\"dina-enc.bdf\")"
# mv dina-enc-*.bdf dina-enc.bdf
# Convert the bdf to psf # Convert the bdf to psf
bdf2psf --fb ./dina-mod.bdf \ bdf2psf --fb ./dina-enc.bdf \
${pkgs.bdf2psf}/share/bdf2psf/standard.equivalents \ ${pkgs.bdf2psf}/share/bdf2psf/standard.equivalents \
${pkgs.bdf2psf}/share/bdf2psf/fontsets/Uni2.512 \ ${pkgs.bdf2psf}/share/bdf2psf/fontsets/Uni3.512 \
512 ./dina.psf 512 ./dina-enc.psfu ./dina.sfm
# Get the font table
psfgettable ./dina-enc.psfu ./dina.table
# Add some entries to the font table
echo "0x0e U+2518" >> ./dina.table
echo "0x0f U+2514" >> ./dina.table
echo "0x10 U+250c" >> ./dina.table
echo "0x11 U+2510" >> ./dina.table
echo "0x12 U+2500" >> ./dina.table
echo "0x13 U+2502" >> ./dina.table
echo "0x14 U+2524" >> ./dina.table
echo "0x15 U+2534" >> ./dina.table
echo "0x16 U+251c" >> ./dina.table
echo "0x17 U+252c" >> ./dina.table
echo "0x18 U+253c" >> ./dina.table
echo "0x19 U+2592" >> ./dina.table
# Rebuild the font
psfstriptable ./dina-enc.psfu ./dina-stripped.psfu
psfaddtable ./dina-stripped.psfu ./dina.table ./dina.psfu
# For debugging, get the table again
psfgettable ./dina.psfu ./dina-final.table
''; '';
installPhase = '' installPhase = ''
install -Dm644 -t $out/share/consolefonts dina.psf install -Dm644 -t $out/debug *
install -Dm644 -t $out/share/consolefonts dina.psfu
''; '';
} }