about summary refs log tree commit diff
path: root/modules/user/aszlig/profiles/workstation
diff options
context:
space:
mode:
authoraszlig <aszlig@nix.build>2020-08-08 01:32:45 +0200
committeraszlig <aszlig@nix.build>2020-08-08 02:56:40 +0200
commit0171f8d895efd46300ba01c6adeb7aa5105ff5c0 (patch)
tree0d0b437eebaaaa74971459483ff63412c48a4e0a /modules/user/aszlig/profiles/workstation
parent9fc8d82e41c3434f8b36f12865a1ca8271495f7e (diff)
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 <aszlig@nix.build>
Diffstat (limited to 'modules/user/aszlig/profiles/workstation')
-rw-r--r--modules/user/aszlig/profiles/workstation/default.nix20
1 files changed, 15 insertions, 5 deletions
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