From 95766f804897d2ff546c9739c572d3a328f474d4 Mon Sep 17 00:00:00 2001
From: Myned <dev@bjork.tech>
Date: Sun, 30 Mar 2025 21:55:23 -0500
Subject: [PATCH] fonts: trim installed font list to mitigate pango performance

---
 options/custom/settings/fonts.nix | 59 +++++++++++++++----------------
 1 file changed, 29 insertions(+), 30 deletions(-)

diff --git a/options/custom/settings/fonts.nix b/options/custom/settings/fonts.nix
index 84a581b..08c804c 100644
--- a/options/custom/settings/fonts.nix
+++ b/options/custom/settings/fonts.nix
@@ -22,62 +22,61 @@ in {
   config = mkIf cfg.enable {
     # https://wiki.nixos.org/wiki/Fonts
     fonts = {
-      enableDefaultPackages = true; # Fallback fonts
-
+      # BUG: Amount of installed fonts impacts pango load times, so only install necessary fonts
+      # https://github.com/davatorium/rofi/issues/673 et al.
       packages = with pkgs.nerd-fonts;
         [
-          # Monospace
           # https://www.nerdfonts.com/#home
-          #?? kitten choose-fonts
-          departure-mono
-          gohufont
-          iosevka-term
+          # Monospace
+          #// departure-mono
+          #// gohufont
+          #// iosevka-term
           iosevka-term-slab
-          jetbrains-mono
-          roboto-mono
-          shure-tech-mono
-          space-mono
-          zed-mono
+          #// jetbrains-mono
+          #// roboto-mono
+          #// shure-tech-mono
+          #// space-mono
+          #// zed-mono
         ]
         ++ (with pkgs; [
+          # https://fonts.google.com/
           (google-fonts.override {
             fonts = [
               # Pixel
-              "Geo"
-              "Silkscreen"
+              #// "Geo"
+              #// "Silkscreen"
 
               # Sans-serif
-              "Josefin Sans"
-              "Jost"
-              "Lexend"
-              "Outfit"
-              "Roboto"
-              "Roboto Flex"
+              #// "Josefin Sans"
+              #// "Jost"
+              #// "Lexend"
+              #// "Outfit"
+              #// "Roboto"
+              #// "Roboto Flex"
 
               # Sans-serif condensed
-              "Oswald"
-              "Roboto Condensed"
+              #// "Oswald"
+              #// "Roboto Condensed"
 
               # Serif
               "Lora"
-              "Roboto Serif"
+              #// "Roboto Serif"
 
               # Slab
-              "Aleo"
+              #// "Aleo"
               "Arvo"
-              "Josefin Slab"
-              "Roboto Slab"
-              "Solway"
+              #// "Josefin Slab"
+              #// "Roboto Slab"
+              #// "Solway"
             ];
           })
 
           # Emoji
-          noto-fonts-color-emoji
+          #// noto-fonts-color-emoji
           noto-fonts-emoji-blob-bin
 
           # Microsoft
-          corefonts
-          vistafonts
+          vista-fonts
 
           # Fallback
           unifont