summary refs log tree commit diff
path: root/nixos/modules/config
diff options
context:
space:
mode:
authorThiago Kenji Okada <thiagokokada@gmail.com>2022-06-26 12:03:01 +0100
committerThiago Kenji Okada <thiagokokada@gmail.com>2022-06-26 12:19:04 +0100
commit659096dd89da4419200b917567f97906805b3131 (patch)
tree16d0649e2d825621ec27edcfff4665ba7855ace6 /nixos/modules/config
parentf2537a505d45c31fe5d9c27ea9829b6f4c4e6ac5 (diff)
downloadnixpkgs-659096dd89da4419200b917567f97906805b3131.tar
nixpkgs-659096dd89da4419200b917567f97906805b3131.tar.gz
nixpkgs-659096dd89da4419200b917567f97906805b3131.tar.bz2
nixpkgs-659096dd89da4419200b917567f97906805b3131.tar.lz
nixpkgs-659096dd89da4419200b917567f97906805b3131.tar.xz
nixpkgs-659096dd89da4419200b917567f97906805b3131.tar.zst
nixpkgs-659096dd89da4419200b917567f97906805b3131.zip
nixos/fontconfig: add fonts.fontconfig.hinting.style option
Diffstat (limited to 'nixos/modules/config')
-rw-r--r--nixos/modules/config/fonts/fontconfig.nix17
1 files changed, 15 insertions, 2 deletions
diff --git a/nixos/modules/config/fonts/fontconfig.nix b/nixos/modules/config/fonts/fontconfig.nix
index 1e68fef7ce7..a10a8c6428a 100644
--- a/nixos/modules/config/fonts/fontconfig.nix
+++ b/nixos/modules/config/fonts/fontconfig.nix
@@ -65,7 +65,7 @@ let
           ${fcBool cfg.hinting.autohint}
         </edit>
         <edit mode="append" name="hintstyle">
-          <const>hintslight</const>
+          <const>${cfg.hinting.style}</const>
         </edit>
         <edit mode="append" name="antialias">
           ${fcBool cfg.antialias}
@@ -226,7 +226,6 @@ in
     (mkRenamedOptionModule [ "fonts" "fontconfig" "ultimate" "useEmbeddedBitmaps" ] [ "fonts" "fontconfig" "useEmbeddedBitmaps" ])
     (mkRenamedOptionModule [ "fonts" "fontconfig" "ultimate" "forceAutohint" ] [ "fonts" "fontconfig" "forceAutohint" ])
     (mkRenamedOptionModule [ "fonts" "fontconfig" "ultimate" "renderMonoTTFAsBitmap" ] [ "fonts" "fontconfig" "renderMonoTTFAsBitmap" ])
-    (mkRemovedOptionModule [ "fonts" "fontconfig" "hinting" "style" ] "")
     (mkRemovedOptionModule [ "fonts" "fontconfig" "forceAutohint" ] "")
     (mkRemovedOptionModule [ "fonts" "fontconfig" "renderMonoTTFAsBitmap" ] "")
     (mkRemovedOptionModule [ "fonts" "fontconfig" "dpi" ] "Use display server-specific options")
@@ -349,6 +348,20 @@ in
               fonts, but better than unhinted fonts.
             '';
           };
+
+          style = mkOption {
+            type = types.enum [ "hintnone" "hintslight" "hintmedium" "hintfull" ];
+            default = "hintslight";
+            description = ''
+              Hintstyle is the amount of font reshaping done to line up
+              to the grid.
+
+              hintslight will make the font more fuzzy to line up to the grid
+              but will be better in retaining font shape, while hintfull will
+              be a crisp font that aligns well to the pixel grid but will lose
+              a greater amount of font shape.
+            '';
+          };
         };
 
         includeUserConf = mkOption {