From 0171f8d895efd46300ba01c6adeb7aa5105ff5c0 Mon Sep 17 00:00:00 2001 From: aszlig Date: Sat, 8 Aug 2020 01:32:45 +0200 Subject: pprofiles/workstation: Use true type VGA font The DOSEMU fonts we were using so far for CP437 were bitmap fonts only and with no unicode support. Luckily there is https://int10h.org/oldschool-pc-fonts/ - which is a really cool font pack containing all the cool oldschool fonts that I remember from my childhood and still use today for creating ASCII art. Since we recently* hit the 21st century, I think it's about time that even I should start having terminals with proper Unicode support. The latter is already the case, but the glyphs just didn't display correctly. The font that I switched to (MxPlus IBM VGA 8x16) is using embededd bitmaps, so I also enabled useEmbeddedBitmaps option, so that the font still looks as crisp as the old DOSEMU font. To make sure it really is the same font, I compared screenshots of all the CP437 characters with the new font and they match the old font 1:1. I also removed the liberation_ttf font, since it's already included by the default NixOS font configuration. * -> Your mileage may vary, but hey, the 90ies were yesterday, right? Signed-off-by: aszlig --- modules/user/aszlig/profiles/workstation/default.nix | 20 +++++++++++++++----- modules/user/aszlig/services/i3/i3.conf | 2 +- 2 files changed, 16 insertions(+), 6 deletions(-) (limited to 'modules') diff --git a/modules/user/aszlig/profiles/workstation/default.nix b/modules/user/aszlig/profiles/workstation/default.nix index bf7385ab..dbe0178f 100644 --- a/modules/user/aszlig/profiles/workstation/default.nix +++ b/modules/user/aszlig/profiles/workstation/default.nix @@ -52,10 +52,18 @@ in { fonts = { enableFontDir = true; enableGhostscriptFonts = true; - fonts = [ - pkgs.dosemu_fonts - pkgs.liberation_ttf - ]; + fontconfig.useEmbeddedBitmaps = true; + # TODO: Switch to nixpkgs version once version 2.0 lands. + fonts = lib.singleton (pkgs.fetchzip { + name = "oldschool-pc-font-pack-2.0"; + url = "https://int10h.org/oldschool-pc-fonts/download/" + + "oldschool_pc_font_pack_v2.0_ttf.zip"; + sha256 = "0z0fw6ni7iq806y4m83xrfx46r14xxxql09ch2gxjqi062awqyh8"; + postFetch= '' + mkdir -p $out/share/fonts/truetype + unzip -j $downloadedFile \*.ttf -d "$out/share/fonts/truetype" + ''; + }); }; vuizvui.user.aszlig.services.i3.enable = true; @@ -164,7 +172,9 @@ in { displayManager.sessionCommands = '' ${pkgs.xorg.xrdb}/bin/xrdb "${pkgs.writeText "xrdb.config" '' XTerm*termName: xterm-256color - XTerm*font: vga + XTerm*faceName: MxPlus IBM VGA 8x16 + XTerm*faceSize: 12 + XTerm*renderFont: true XTerm*saveLines: 10000 XTerm*bellIsUrgent: true XTerm*background: black diff --git a/modules/user/aszlig/services/i3/i3.conf b/modules/user/aszlig/services/i3/i3.conf index cd14c425..6e9307f2 100644 --- a/modules/user/aszlig/services/i3/i3.conf +++ b/modules/user/aszlig/services/i3/i3.conf @@ -2,7 +2,7 @@ set $mod Mod4 # we want to have a VT-style font :-) -font -dosemu-vga-medium-r-normal--17-160-75-75-c-80-ibm-cp866 +font pango:MxPlus IBM VGA 8x16 12 # Use Mouse+$mod to drag floating windows to their wanted position floating_modifier $mod -- cgit 1.4.1