all repos — nixfiles @ 7e5653c280976af97aa4210a08f1bd2a89fcfb39

System and user configuration, managed by nix and home-manager

xserver: improve font setup
Alan Pearce alan@alanpearce.eu
Fri, 29 Nov 2019 15:36:47 +0100
commit

7e5653c280976af97aa4210a08f1bd2a89fcfb39

parent

c2e1756638cd03398354090746854f4ccf41abcb

1 files changed, 22 insertions(+), 11 deletions(-)

jump to
M system/settings/services/xserver.nixsystem/settings/services/xserver.nix
@@ -34,19 +34,34 @@ enableDefaultFonts = false;     fontconfig = {
       antialias = true;
       subpixel = mkIf config.fonts.fontconfig.antialias {
-        lcdfilter = "light";
+        lcdfilter = "default";
+        rgba = "rgb";
       };
       ultimate = mkIf config.fonts.fontconfig.antialias {
         enable = true;
-        preset = "ultimate3";
-        substitutions = "ms";
+        preset = "ultimate1";
+        substitutions = "combi";
       };
       useEmbeddedBitmaps = !config.fonts.fontconfig.antialias;
       defaultFonts = {
-        monospace = [ "Source Code Pro" ];
-        sansSerif = [ "Tahoma" ];
+        monospace = [ "IBM Plex Mono" ];
+        sansSerif = [ "Cantarell" ];
         serif = [ "Times New Roman" ];
       };
+
+      localConf = ''
+        <?xml version='1.0'?>
+        <!DOCTYPE fontconfig SYSTEM 'fonts.dtd'>
+        <fontconfig>
+          <match target="font">
+            <test name="weight" compare="more">
+              <const>medium</const>
+            </test>
+            <edit name="autohint" mode="assign">
+              <bool>false</bool>
+            </edit>
+          </match>
+      '';
     };
     fonts = with pkgs; [
       gohufont
@@ -63,17 +78,13 @@ xorg.fontmiscmisc       xorg.fontcursormisc
       xorg.fontbhlucidatypewriter100dpi
     ] ++ lib.optionals config.fonts.fontconfig.antialias [
+      cantarell-fonts
+
       fira
       fira-code
       fira-mono
-      go-font
       ibm-plex
 
-      liberation_ttf
-      mononoki
-      roboto
-      roboto-mono
-      roboto-slab
       source-code-pro
       source-sans-pro
       source-serif-pro