diff options
-rw-r--r-- | nixos/doc/manual/release-notes/rl-1609.xml | 8 | ||||
-rw-r--r-- | nixos/modules/config/fonts/fontconfig-ultimate.nix | 47 | ||||
-rw-r--r-- | nixos/modules/rename.nix | 3 | ||||
-rw-r--r-- | pkgs/development/libraries/fontconfig-ultimate/confd.nix | 43 | ||||
-rw-r--r-- | pkgs/development/libraries/fontconfig-ultimate/default.nix | 45 | ||||
-rw-r--r-- | pkgs/development/libraries/fontconfig-ultimate/rendering.nix | 212 |
6 files changed, 63 insertions, 295 deletions
diff --git a/nixos/doc/manual/release-notes/rl-1609.xml b/nixos/doc/manual/release-notes/rl-1609.xml index 8dd4e1a9f642..1245411be179 100644 --- a/nixos/doc/manual/release-notes/rl-1609.xml +++ b/nixos/doc/manual/release-notes/rl-1609.xml @@ -58,6 +58,14 @@ following incompatible changes:</para> official documentation</link>.</para> </listitem> + <listitem> + <para><literal>fonts.fontconfig.ultimate.rendering</literal> was removed + because our presets were obsolete for some time. New presets are hardcoded + into freetype; one selects a preset via <literal>fonts.fontconfig.ultimate.preset</literal>. + You can customize those presets via ordinary environment variables, using + <literal>environment.variables</literal>.</para> + </listitem> + </itemizedlist> diff --git a/nixos/modules/config/fonts/fontconfig-ultimate.nix b/nixos/modules/config/fonts/fontconfig-ultimate.nix index 3ea6e1fa53bf..a3f52fbd9199 100644 --- a/nixos/modules/config/fonts/fontconfig-ultimate.nix +++ b/nixos/modules/config/fonts/fontconfig-ultimate.nix @@ -79,16 +79,16 @@ let fcBool = x: if x then "<bool>true</bool>" else "<bool>false</bool>"; # fontconfig ultimate substitutions ${optionalString (cfg.substitutions != "none") '' - ln -s ${pkgs.fontconfig-ultimate.confd}/etc/fonts/presets/${cfg.substitutions}/*.conf \ + ln -s ${pkgs.fontconfig-ultimate}/etc/fonts/presets/${cfg.substitutions}/*.conf \ $support_folder - ln -s ${pkgs.fontconfig-ultimate.confd}/etc/fonts/presets/${cfg.substitutions}/*.conf \ + ln -s ${pkgs.fontconfig-ultimate}/etc/fonts/presets/${cfg.substitutions}/*.conf \ $latest_folder ''} # fontconfig ultimate various configuration files - ln -s ${pkgs.fontconfig-ultimate.confd}/etc/fonts/conf.d/*.conf \ + ln -s ${pkgs.fontconfig-ultimate}/etc/fonts/conf.d/*.conf \ $support_folder - ln -s ${pkgs.fontconfig-ultimate.confd}/etc/fonts/conf.d/*.conf \ + ln -s ${pkgs.fontconfig-ultimate}/etc/fonts/conf.d/*.conf \ $latest_folder ''; @@ -153,9 +153,7 @@ in }; substitutions = mkOption { - type = types.str // { - check = flip elem ["none" "free" "combi" "ms"]; - }; + type = types.nullOr (types.enum ["free" "combi" "ms"]); default = "free"; description = '' Font substitutions to replace common Type 1 fonts with nicer @@ -166,35 +164,12 @@ in ''; }; - rendering = mkOption { - type = types.attrs; - default = pkgs.fontconfig-ultimate.rendering.ultimate; + preset = mkOption { + type = types.enum ["ultimate1" "ultimate2" "ultimate3" "ultimate4" "ultimate5" "osx" "windowsxp"]; + default = "ultimate3"; description = '' - FreeType rendering settings presets. The default is - <literal>pkgs.fontconfig-ultimate.rendering.ultimate</literal>. - The other available styles are: - <literal>ultimate-lighter</literal>, - <literal>ultimate-darker</literal>, - <literal>ultimate-lightest</literal>, - <literal>ultimate-darkest</literal>, - <literal>default</literal> (the original Infinality default), - <literal>osx</literal>, - <literal>ipad</literal>, - <literal>ubuntu</literal>, - <literal>linux</literal>, - <literal>winxplight</literal>, - <literal>win7light</literal>, - <literal>winxp</literal>, - <literal>win7</literal>, - <literal>vanilla</literal>, - <literal>classic</literal>, - <literal>nudge</literal>, - <literal>push</literal>, - <literal>shove</literal>, - <literal>sharpened</literal>, - <literal>infinality</literal>. Any of the presets may be - customized by editing the attributes. To disable, set this option - to the empty attribute set <literal>{}</literal>. + FreeType rendering settings preset. Any of the presets may be + customized by setting environment variables. ''; }; }; @@ -206,7 +181,7 @@ in config = mkIf (config.fonts.fontconfig.enable && cfg.enable) { fonts.fontconfig.confPackages = [ confPkg ]; - environment.variables = cfg.rendering; + environment.variables."INFINALITY_FT" = cfg.preset; }; diff --git a/nixos/modules/rename.nix b/nixos/modules/rename.nix index 3f8a770cbce7..3caac6c4ee60 100644 --- a/nixos/modules/rename.nix +++ b/nixos/modules/rename.nix @@ -137,6 +137,9 @@ with lib; # Unity3D (mkRenamedOptionModule [ "programs" "unity3d" "enable" ] [ "security" "chromiumSuidSandbox" "enable" ]) + # fontconfig-ultimate + (mkRenamedOptionModule [ "fonts" "fontconfig" "ultimate" "rendering" ] [ "fonts" "fontconfig" "ultimate" "preset" ]) + # Options that are obsolete and have no replacement. (mkRemovedOptionModule [ "boot" "initrd" "luks" "enable" ]) (mkRemovedOptionModule [ "programs" "bash" "enable" ]) diff --git a/pkgs/development/libraries/fontconfig-ultimate/confd.nix b/pkgs/development/libraries/fontconfig-ultimate/confd.nix deleted file mode 100644 index 31679aa08064..000000000000 --- a/pkgs/development/libraries/fontconfig-ultimate/confd.nix +++ /dev/null @@ -1,43 +0,0 @@ -{ stdenv, fetchFromGitHub }: - -let version = "2015-12-06"; in -stdenv.mkDerivation { - name = "fontconfig-ultimate-${version}"; - - src = fetchFromGitHub { - sha256 = "02a811szxkq4q088nxfpdzp6rv0brvgkdhwigk09qffygxd776g6"; - rev = version; - repo = "fontconfig-ultimate"; - owner = "bohoomil"; - }; - - phases = "$prePhases unpackPhase installPhase $postPhases"; - - installPhase = '' - mkdir -p $out/etc/fonts/conf.d - cp conf.d.infinality/*.conf $out/etc/fonts/conf.d - - # Base rendering settings will be determined by NixOS module - rm $out/etc/fonts/conf.d/10-base-rendering.conf - - # Options controlled by NixOS module - rm $out/etc/fonts/conf.d/35-repl-custom.conf - rm $out/etc/fonts/conf.d/38-repl-*.conf - rm $out/etc/fonts/conf.d/82-*.conf - rm $out/etc/fonts/conf.d/83-*.conf - - # Inclusion of local and user configs handled by global configuration - rm $out/etc/fonts/conf.d/29-local.conf - rm $out/etc/fonts/conf.d/28-user.conf - - cp fontconfig_patches/fonts-settings/*.conf $out/etc/fonts/conf.d - - # fix font priority issue https://github.com/bohoomil/fontconfig-ultimate/issues/173 - mv $out/etc/fonts/conf.d/{43,60}-wqy-zenhei-sharp.conf - - mkdir -p $out/etc/fonts/presets/{combi,free,ms} - cp fontconfig_patches/combi/*.conf $out/etc/fonts/presets/combi - cp fontconfig_patches/free/*.conf $out/etc/fonts/presets/free - cp fontconfig_patches/ms/*.conf $out/etc/fonts/presets/ms - ''; -} diff --git a/pkgs/development/libraries/fontconfig-ultimate/default.nix b/pkgs/development/libraries/fontconfig-ultimate/default.nix index aa799d850d7d..efef59cad3b6 100644 --- a/pkgs/development/libraries/fontconfig-ultimate/default.nix +++ b/pkgs/development/libraries/fontconfig-ultimate/default.nix @@ -1,6 +1,43 @@ -{ callPackage }: +{ stdenv, fetchFromGitHub }: -{ - confd = callPackage ./confd.nix {}; - rendering = callPackage ./rendering.nix {}; +let version = "2016-04-23"; in +stdenv.mkDerivation { + name = "fontconfig-ultimate-${version}"; + + src = fetchFromGitHub { + sha256 = "1rd2n60l8bamx84q3l91pd9a0wz9h7p6ajvx1dw22qn8rah4h498"; + rev = version; + repo = "fontconfig-ultimate"; + owner = "bohoomil"; + }; + + phases = "$prePhases unpackPhase installPhase $postPhases"; + + installPhase = '' + mkdir -p $out/etc/fonts/conf.d + cp conf.d.infinality/*.conf $out/etc/fonts/conf.d + + # Base rendering settings will be determined by NixOS module + rm $out/etc/fonts/conf.d/10-base-rendering.conf + + # Options controlled by NixOS module + rm $out/etc/fonts/conf.d/35-repl-custom.conf + rm $out/etc/fonts/conf.d/38-repl-*.conf + rm $out/etc/fonts/conf.d/82-*.conf + rm $out/etc/fonts/conf.d/83-*.conf + + # Inclusion of local and user configs handled by global configuration + rm $out/etc/fonts/conf.d/29-local.conf + rm $out/etc/fonts/conf.d/28-user.conf + + cp fontconfig_patches/fonts-settings/*.conf $out/etc/fonts/conf.d + + # fix font priority issue https://github.com/bohoomil/fontconfig-ultimate/issues/173 + mv $out/etc/fonts/conf.d/{43,60}-wqy-zenhei-sharp.conf + + mkdir -p $out/etc/fonts/presets/{combi,free,ms} + cp fontconfig_patches/combi/*.conf $out/etc/fonts/presets/combi + cp fontconfig_patches/free/*.conf $out/etc/fonts/presets/free + cp fontconfig_patches/ms/*.conf $out/etc/fonts/presets/ms + ''; } diff --git a/pkgs/development/libraries/fontconfig-ultimate/rendering.nix b/pkgs/development/libraries/fontconfig-ultimate/rendering.nix deleted file mode 100644 index b1de43b49b2c..000000000000 --- a/pkgs/development/libraries/fontconfig-ultimate/rendering.nix +++ /dev/null @@ -1,212 +0,0 @@ -{}: - -rec { - default = { - INFINALITY_FT_FILTER_PARAMS="11 22 38 22 11"; - INFINALITY_FT_GRAYSCALE_FILTER_STRENGTH="0"; - INFINALITY_FT_FRINGE_FILTER_STRENGTH="0"; - INFINALITY_FT_AUTOHINT_HORIZONTAL_STEM_DARKEN_STRENGTH="10"; - INFINALITY_FT_AUTOHINT_VERTICAL_STEM_DARKEN_STRENGTH="25"; - INFINALITY_FT_WINDOWS_STYLE_SHARPENING_STRENGTH="10"; - INFINALITY_FT_CHROMEOS_STYLE_SHARPENING_STRENGTH="0"; - INFINALITY_FT_STEM_ALIGNMENT_STRENGTH="25"; - INFINALITY_FT_STEM_FITTING_STRENGTH="25"; - INFINALITY_FT_GAMMA_CORRECTION="0 100"; - INFINALITY_FT_BRIGHTNESS="0"; - INFINALITY_FT_CONTRAST="0"; - INFINALITY_FT_USE_VARIOUS_TWEAKS="true"; - INFINALITY_FT_AUTOHINT_INCREASE_GLYPH_HEIGHTS="true"; - INFINALITY_FT_AUTOHINT_SNAP_STEM_HEIGHT="100"; - INFINALITY_FT_STEM_SNAPPING_SLIDING_SCALE="40"; - INFINALITY_FT_USE_KNOWN_SETTINGS_ON_SELECTED_FONTS="true"; - INFINALITY_FT_GLOBAL_EMBOLDEN_X_VALUE="0"; - INFINALITY_FT_GLOBAL_EMBOLDEN_Y_VALUE="0"; - INFINALITY_FT_BOLD_EMBOLDEN_X_VALUE="0"; - INFINALITY_FT_BOLD_EMBOLDEN_Y_VALUE="0"; - }; - - osx = default // { - INFINALITY_FT_FILTER_PARAMS="03 32 38 32 03"; - INFINALITY_FT_GRAYSCALE_FILTER_STRENGTH="25"; - INFINALITY_FT_WINDOWS_STYLE_SHARPENING_STRENGTH="0"; - INFINALITY_FT_STEM_ALIGNMENT_STRENGTH="0"; - INFINALITY_FT_STEM_FITTING_STRENGTH="0"; - INFINALITY_FT_GAMMA_CORRECTION="1000 80"; - INFINALITY_FT_BRIGHTNESS="10"; - INFINALITY_FT_CONTRAST="20"; - INFINALITY_FT_USE_VARIOUS_TWEAKS="false"; - INFINALITY_FT_AUTOHINT_INCREASE_GLYPH_HEIGHTS="false"; - INFINALITY_FT_AUTOHINT_SNAP_STEM_HEIGHT="0"; - INFINALITY_FT_STEM_SNAPPING_SLIDING_SCALE="0"; - INFINALITY_FT_USE_KNOWN_SETTINGS_ON_SELECTED_FONTS="false"; - INFINALITY_FT_GLOBAL_EMBOLDEN_Y_VALUE="8"; - INFINALITY_FT_BOLD_EMBOLDEN_X_VALUE="16"; - }; - - ipad = default // { - INFINALITY_FT_FILTER_PARAMS="00 00 100 00 00"; - INFINALITY_FT_GRAYSCALE_FILTER_STRENGTH="100"; - INFINALITY_FT_AUTOHINT_HORIZONTAL_STEM_DARKEN_STRENGTH="0"; - INFINALITY_FT_AUTOHINT_VERTICAL_STEM_DARKEN_STRENGTH="0"; - INFINALITY_FT_WINDOWS_STYLE_SHARPENING_STRENGTH="0"; - INFINALITY_FT_STEM_ALIGNMENT_STRENGTH="0"; - INFINALITY_FT_STEM_FITTING_STRENGTH="0"; - INFINALITY_FT_GAMMA_CORRECTION="1000 80"; - INFINALITY_FT_USE_VARIOUS_TWEAKS="false"; - INFINALITY_FT_AUTOHINT_INCREASE_GLYPH_HEIGHTS="false"; - INFINALITY_FT_AUTOHINT_SNAP_STEM_HEIGHT="0"; - INFINALITY_FT_STEM_SNAPPING_SLIDING_SCALE="0"; - INFINALITY_FT_USE_KNOWN_SETTINGS_ON_SELECTED_FONTS="false"; - }; - - ubuntu = default // { - INFINALITY_FT_WINDOWS_STYLE_SHARPENING_STRENGTH="0"; - INFINALITY_FT_STEM_ALIGNMENT_STRENGTH="0"; - INFINALITY_FT_STEM_FITTING_STRENGTH="0"; - INFINALITY_FT_GAMMA_CORRECTION="1000 80"; - INFINALITY_FT_BRIGHTNESS="-10"; - INFINALITY_FT_CONTRAST="15"; - INFINALITY_FT_USE_VARIOUS_TWEAKS="false"; - INFINALITY_FT_AUTOHINT_INCREASE_GLYPH_HEIGHTS="false"; - INFINALITY_FT_AUTOHINT_SNAP_STEM_HEIGHT="0"; - INFINALITY_FT_STEM_SNAPPING_SLIDING_SCALE="0"; - INFINALITY_FT_USE_KNOWN_SETTINGS_ON_SELECTED_FONTS="false"; - }; - - linux = default // { - INFINALITY_FT_FILTER_PARAMS="06 25 44 25 06"; - INFINALITY_FT_WINDOWS_STYLE_SHARPENING_STRENGTH="0"; - INFINALITY_FT_STEM_ALIGNMENT_STRENGTH="0"; - INFINALITY_FT_STEM_FITTING_STRENGTH="0"; - INFINALITY_FT_AUTOHINT_INCREASE_GLYPH_HEIGHTS="false"; - INFINALITY_FT_AUTOHINT_SNAP_STEM_HEIGHT="100"; - INFINALITY_FT_USE_KNOWN_SETTINGS_ON_SELECTED_FONTS="false"; - }; - - winxplight = default // { - INFINALITY_FT_FILTER_PARAMS="06 25 44 25 06"; - INFINALITY_FT_FRINGE_FILTER_STRENGTH="100"; - INFINALITY_FT_WINDOWS_STYLE_SHARPENING_STRENGTH="65"; - INFINALITY_FT_STEM_ALIGNMENT_STRENGTH="15"; - INFINALITY_FT_STEM_FITTING_STRENGTH="15"; - INFINALITY_FT_GAMMA_CORRECTION="1000 120"; - INFINALITY_FT_BRIGHTNESS="20"; - INFINALITY_FT_CONTRAST="30"; - INFINALITY_FT_AUTOHINT_INCREASE_GLYPH_HEIGHTS="false"; - INFINALITY_FT_STEM_SNAPPING_SLIDING_SCALE="30"; - }; - - win7light = default // { - INFINALITY_FT_FILTER_PARAMS="20 25 38 25 05"; - INFINALITY_FT_FRINGE_FILTER_STRENGTH="100"; - INFINALITY_FT_WINDOWS_STYLE_SHARPENING_STRENGTH="100"; - INFINALITY_FT_STEM_ALIGNMENT_STRENGTH="0"; - INFINALITY_FT_STEM_FITTING_STRENGTH="0"; - INFINALITY_FT_GAMMA_CORRECTION="1000 160"; - INFINALITY_FT_CONTRAST="20"; - INFINALITY_FT_AUTOHINT_INCREASE_GLYPH_HEIGHTS="false"; - INFINALITY_FT_STEM_SNAPPING_SLIDING_SCALE="30"; - }; - - winxp = default // { - INFINALITY_FT_FILTER_PARAMS="06 25 44 25 06"; - INFINALITY_FT_FRINGE_FILTER_STRENGTH="100"; - INFINALITY_FT_WINDOWS_STYLE_SHARPENING_STRENGTH="65"; - INFINALITY_FT_STEM_ALIGNMENT_STRENGTH="15"; - INFINALITY_FT_STEM_FITTING_STRENGTH="15"; - INFINALITY_FT_GAMMA_CORRECTION="1000 120"; - INFINALITY_FT_BRIGHTNESS="10"; - INFINALITY_FT_CONTRAST="20"; - INFINALITY_FT_AUTOHINT_INCREASE_GLYPH_HEIGHTS="false"; - INFINALITY_FT_STEM_SNAPPING_SLIDING_SCALE="30"; - }; - - win7 = default // { - INFINALITY_FT_FILTER_PARAMS="20 25 42 25 06"; - INFINALITY_FT_FRINGE_FILTER_STRENGTH="100"; - INFINALITY_FT_WINDOWS_STYLE_SHARPENING_STRENGTH="65"; - INFINALITY_FT_STEM_ALIGNMENT_STRENGTH="0"; - INFINALITY_FT_STEM_FITTING_STRENGTH="0"; - INFINALITY_FT_GAMMA_CORRECTION="1000 120"; - INFINALITY_FT_BRIGHTNESS="10"; - INFINALITY_FT_CONTRAST="20"; - INFINALITY_FT_AUTOHINT_INCREASE_GLYPH_HEIGHTS="false"; - INFINALITY_FT_STEM_SNAPPING_SLIDING_SCALE="0"; - }; - - vanilla = default // { - INFINALITY_FT_FILTER_PARAMS="06 25 38 25 06"; - INFINALITY_FT_AUTOHINT_HORIZONTAL_STEM_DARKEN_STRENGTH="0"; - INFINALITY_FT_AUTOHINT_VERTICAL_STEM_DARKEN_STRENGTH="0"; - INFINALITY_FT_WINDOWS_STYLE_SHARPENING_STRENGTH="0"; - INFINALITY_FT_STEM_ALIGNMENT_STRENGTH="0"; - INFINALITY_FT_STEM_FITTING_STRENGTH="0"; - INFINALITY_FT_USE_VARIOUS_TWEAKS="false"; - INFINALITY_FT_AUTOHINT_INCREASE_GLYPH_HEIGHTS="false"; - INFINALITY_FT_AUTOHINT_SNAP_STEM_HEIGHT="0"; - INFINALITY_FT_STEM_SNAPPING_SLIDING_SCALE="0"; - INFINALITY_FT_USE_KNOWN_SETTINGS_ON_SELECTED_FONTS="false"; - }; - - classic = default // { - INFINALITY_FT_FILTER_PARAMS="06 25 38 25 06"; - INFINALITY_FT_AUTOHINT_HORIZONTAL_STEM_DARKEN_STRENGTH="0"; - INFINALITY_FT_AUTOHINT_VERTICAL_STEM_DARKEN_STRENGTH="0"; - INFINALITY_FT_WINDOWS_STYLE_SHARPENING_STRENGTH="0"; - INFINALITY_FT_STEM_ALIGNMENT_STRENGTH="0"; - INFINALITY_FT_STEM_FITTING_STRENGTH="0"; - INFINALITY_FT_STEM_SNAPPING_SLIDING_SCALE="0"; - INFINALITY_FT_USE_KNOWN_SETTINGS_ON_SELECTED_FONTS="false"; - }; - - nudge = default // { - INFINALITY_FT_WINDOWS_STYLE_SHARPENING_STRENGTH="0"; - INFINALITY_FT_STEM_SNAPPING_SLIDING_SCALE="30"; - INFINALITY_FT_USE_KNOWN_SETTINGS_ON_SELECTED_FONTS="false"; - }; - - push = default // { - INFINALITY_FT_WINDOWS_STYLE_SHARPENING_STRENGTH="0"; - INFINALITY_FT_STEM_ALIGNMENT_STRENGTH="75"; - INFINALITY_FT_STEM_FITTING_STRENGTH="50"; - INFINALITY_FT_STEM_SNAPPING_SLIDING_SCALE="30"; - }; - - infinality = default // { - INFINALITY_FT_WINDOWS_STYLE_SHARPENING_STRENGTH="5"; - }; - - shove = default // { - INFINALITY_FT_WINDOWS_STYLE_SHARPENING_STRENGTH="0"; - INFINALITY_FT_STEM_ALIGNMENT_STRENGTH="100"; - INFINALITY_FT_STEM_FITTING_STRENGTH="100"; - INFINALITY_FT_STEM_SNAPPING_SLIDING_SCALE="0"; - }; - - sharpened = default // { - INFINALITY_FT_WINDOWS_STYLE_SHARPENING_STRENGTH="65"; - }; - - ultimate = { - INFINALITY_FT_FILTER_PARAMS="08 24 36 24 08"; - INFINALITY_FT_FRINGE_FILTER_STRENGTH="50"; - INFINALITY_FT_USE_VARIOUS_TWEAKS="true"; - INFINALITY_FT_CHROMEOS_STYLE_SHARPENING_STRENGTH="20"; - }; - - ultimate-lighter = ultimate // { - INFINALITY_FT_FILTER_PARAMS="06 22 36 22 06"; - }; - - ultimate-lightest = ultimate // { - INFINALITY_FT_FILTER_PARAMS="04 22 38 22 04"; - }; - - ultimate-darker = ultimate // { - INFINALITY_FT_FILTER_PARAMS="10 25 37 25 10"; - }; - - ultimate-darkest = ultimate // { - INFINALITY_FT_FILTER_PARAMS="12 28 42 28 12"; - }; -} |