diff options
author | Thomas Tuegel <ttuegel@secure.mailbox.org> | 2017-03-20 11:43:50 -0500 |
---|---|---|
committer | GitHub <noreply@github.com> | 2017-03-20 11:43:50 -0500 |
commit | 1b0d9e9ae64b677c09f345f740f5a94fa41eb468 (patch) | |
tree | 1cbb71acfb427c9521ea4552853692898ee755c4 /nixos/modules/config/fonts | |
parent | 48bc3cf9f497f38d0bfcf0ac6a808a1cd411a855 (diff) | |
parent | d458b5401a36dd87cfd2bd071f634330f095cf5d (diff) |
Merge pull request #23819 from ttuegel/freetype
FreeType 2.7.1 and Fontconfig defaults
Diffstat (limited to 'nixos/modules/config/fonts')
-rw-r--r-- | nixos/modules/config/fonts/fontconfig-penultimate.nix | 57 | ||||
-rw-r--r-- | nixos/modules/config/fonts/fontconfig-ultimate.nix | 12 | ||||
-rw-r--r-- | nixos/modules/config/fonts/fontconfig.nix | 55 |
3 files changed, 90 insertions, 34 deletions
diff --git a/nixos/modules/config/fonts/fontconfig-penultimate.nix b/nixos/modules/config/fonts/fontconfig-penultimate.nix new file mode 100644 index 000000000000..8e41d3421173 --- /dev/null +++ b/nixos/modules/config/fonts/fontconfig-penultimate.nix @@ -0,0 +1,57 @@ +{ config, pkgs, lib, ... }: + +with lib; + +let + cfg = config.fonts.fontconfig.penultimate; + + latestVersion = pkgs.fontconfig.configVersion; + + # The configuration to be included in /etc/font/ + confPkg = pkgs.runCommand "font-penultimate-conf" {} '' + support_folder=$out/etc/fonts/conf.d + latest_folder=$out/etc/fonts/${latestVersion}/conf.d + + mkdir -p $support_folder + mkdir -p $latest_folder + + # fontconfig ultimate various configuration files + ln -s ${pkgs.fontconfig-penultimate}/etc/fonts/conf.d/*.conf \ + $support_folder + ln -s ${pkgs.fontconfig-penultimate}/etc/fonts/conf.d/*.conf \ + $latest_folder + ''; + +in +{ + + options = { + + fonts = { + + fontconfig = { + + penultimate = { + enable = mkOption { + type = types.bool; + default = true; + description = '' + Enable fontconfig-penultimate settings to supplement the + NixOS defaults by providing per-font rendering defaults and + metric aliases. + ''; + }; + }; + + }; + }; + + }; + + config = mkIf (config.fonts.fontconfig.enable && cfg.enable) { + + fonts.fontconfig.confPackages = [ confPkg ]; + + }; + +} diff --git a/nixos/modules/config/fonts/fontconfig-ultimate.nix b/nixos/modules/config/fonts/fontconfig-ultimate.nix index ed6429dda085..e412146a0394 100644 --- a/nixos/modules/config/fonts/fontconfig-ultimate.nix +++ b/nixos/modules/config/fonts/fontconfig-ultimate.nix @@ -43,7 +43,7 @@ in ultimate = { enable = mkOption { type = types.bool; - default = true; + default = false; description = '' Enable fontconfig-ultimate settings (formerly known as Infinality). Besides the customizable settings in this NixOS @@ -63,15 +63,6 @@ in <literal>none</literal> disables the substitutions. ''; }; - - preset = mkOption { - type = types.enum ["ultimate1" "ultimate2" "ultimate3" "ultimate4" "ultimate5" "osx" "windowsxp"]; - default = "ultimate3"; - description = '' - FreeType rendering settings preset. Any of the presets may be - customized by setting environment variables. - ''; - }; }; }; }; @@ -81,7 +72,6 @@ in config = mkIf (config.fonts.fontconfig.enable && cfg.enable) { fonts.fontconfig.confPackages = [ confPkg ]; - environment.variables."INFINALITY_FT" = cfg.preset; }; diff --git a/nixos/modules/config/fonts/fontconfig.nix b/nixos/modules/config/fonts/fontconfig.nix index 5648b7b1d027..4d3cc26365fc 100644 --- a/nixos/modules/config/fonts/fontconfig.nix +++ b/nixos/modules/config/fonts/fontconfig.nix @@ -75,23 +75,23 @@ let cfg = config.fonts.fontconfig; <fontconfig> <!-- Default rendering settings --> - <match target="font"> - <edit mode="assign" name="hinting"> + <match target="pattern"> + <edit mode="append" name="hinting"> ${fcBool cfg.hinting.enable} </edit> - <edit mode="assign" name="autohint"> + <edit mode="append" name="autohint"> ${fcBool cfg.hinting.autohint} </edit> - <edit mode="assign" name="hintstyle"> - <const>hint${cfg.hinting.style}</const> + <edit mode="append" name="hintstyle"> + <const>hintslight</const> </edit> - <edit mode="assign" name="antialias"> + <edit mode="append" name="antialias"> ${fcBool cfg.antialias} </edit> - <edit mode="assign" name="rgba"> + <edit mode="append" name="rgba"> <const>${cfg.subpixel.rgba}</const> </edit> - <edit mode="assign" name="lcdfilter"> + <edit mode="append" name="lcdfilter"> <const>lcd${cfg.subpixel.lcdfilter}</const> </edit> </match> @@ -304,7 +304,11 @@ in antialias = mkOption { type = types.bool; default = true; - description = "Enable font antialiasing."; + description = '' + Enable font antialiasing. At high resolution (> 200 DPI), + antialiasing has no visible effect; users of such displays may want + to disable this option. + ''; }; dpi = mkOption { @@ -320,7 +324,7 @@ in type = types.lines; default = ""; description = '' - System-wide customization file contents, has higher priority than + System-wide customization file contents, has higher priority than <literal>defaultFonts</literal> settings. ''; }; @@ -358,7 +362,12 @@ in enable = mkOption { type = types.bool; default = true; - description = "Enable TrueType hinting."; + description = '' + Enable font hinting. Hinting aligns glyphs to pixel boundaries to + improve rendering sharpness at low resolution. At high resolution + (> 200 dpi) hinting will do nothing (at best); users of such + displays may want to disable this option. + ''; }; autohint = mkOption { @@ -370,16 +379,6 @@ in correctly-hinted fonts. ''; }; - - style = mkOption { - type = types.enum ["none" "slight" "medium" "full"]; - default = "full"; - description = '' - TrueType hinting style, one of <literal>none</literal>, - <literal>slight</literal>, <literal>medium</literal>, or - <literal>full</literal>. - ''; - }; }; includeUserConf = mkOption { @@ -398,7 +397,15 @@ in default = "rgb"; type = types.enum ["rgb" "bgr" "vrgb" "vbgr" "none"]; description = '' - Subpixel order. + Subpixel order. The overwhelming majority of displays are + <literal>rgb</literal> in their normal orientation. Select + <literal>vrgb</literal> for mounting such a display 90 degrees + clockwise from its normal orientation or <literal>vbgr</literal> + for mounting 90 degrees counter-clockwise. Select + <literal>bgr</literal> in the unlikely event of mounting 180 + degrees from the normal orientation. Reverse these directions in + the improbable event that the display's native subpixel order is + <literal>bgr</literal>. ''; }; @@ -406,7 +413,9 @@ in default = "default"; type = types.enum ["none" "default" "light" "legacy"]; description = '' - FreeType LCD filter. + FreeType LCD filter. At high resolution (> 200 DPI), LCD filtering + has no visible effect; users of such displays may want to select + <literal>none</literal>. ''; }; |