mirror of
https://github.com/NixOS/nixpkgs.git
synced 2025-01-30 00:34:00 +00:00
Merge branch 'fontconfig-ultimate'
This commit is contained in:
commit
aff0cd143b
193
nixos/modules/config/fonts/fontconfig-ultimate.nix
Normal file
193
nixos/modules/config/fonts/fontconfig-ultimate.nix
Normal file
@ -0,0 +1,193 @@
|
||||
{ config, pkgs, ... }:
|
||||
|
||||
with pkgs.lib;
|
||||
|
||||
let fcBool = x: if x then "<bool>true</bool>" else "<bool>false</bool>";
|
||||
in
|
||||
{
|
||||
|
||||
options = {
|
||||
|
||||
fonts = {
|
||||
|
||||
fontconfig = {
|
||||
|
||||
ultimate = {
|
||||
enable = mkOption {
|
||||
type = types.bool;
|
||||
default = true;
|
||||
description = ''
|
||||
Enable fontconfig-ultimate settings (formerly known as
|
||||
Infinality). Besides the customizable settings in this NixOS
|
||||
module, fontconfig-ultimate also provides many font-specific
|
||||
rendering tweaks.
|
||||
'';
|
||||
};
|
||||
|
||||
allowBitmaps = mkOption {
|
||||
type = types.bool;
|
||||
default = true;
|
||||
description = ''
|
||||
Allow bitmap fonts. Set to <literal>false</literal> to ban all
|
||||
bitmap fonts.
|
||||
'';
|
||||
};
|
||||
|
||||
allowType1 = mkOption {
|
||||
type = types.bool;
|
||||
default = false;
|
||||
description = ''
|
||||
Allow Type-1 fonts. Default is <literal>false</literal> because of
|
||||
poor rendering.
|
||||
'';
|
||||
};
|
||||
|
||||
useEmbeddedBitmaps = mkOption {
|
||||
type = types.bool;
|
||||
default = false;
|
||||
description = ''Use embedded bitmaps in fonts like Calibri.'';
|
||||
};
|
||||
|
||||
forceAutohint = mkOption {
|
||||
type = types.bool;
|
||||
default = false;
|
||||
description = ''
|
||||
Force use of the TrueType Autohinter. Useful for debugging or
|
||||
free-software purists.
|
||||
'';
|
||||
};
|
||||
|
||||
renderMonoTTFAsBitmap = mkOption {
|
||||
type = types.bool;
|
||||
default = false;
|
||||
description = ''Render some monospace TTF fonts as bitmaps.'';
|
||||
};
|
||||
|
||||
substitutions = mkOption {
|
||||
type = types.str // {
|
||||
check = flip elem ["none" "free" "combi" "ms"];
|
||||
};
|
||||
default = "free";
|
||||
description = ''
|
||||
Font substitutions to replace common Type 1 fonts with nicer
|
||||
TrueType fonts. <literal>free</literal> uses free fonts,
|
||||
<literal>ms</literal> uses Microsoft fonts,
|
||||
<literal>combi</literal> uses a combination, and
|
||||
<literal>none</literal> disables the substitutions.
|
||||
'';
|
||||
};
|
||||
|
||||
rendering = mkOption {
|
||||
type = types.attrs;
|
||||
default = pkgs.fontconfig-ultimate.rendering.ultimate;
|
||||
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>.
|
||||
'';
|
||||
};
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
};
|
||||
|
||||
|
||||
config =
|
||||
let ultimate = config.fonts.fontconfig.ultimate;
|
||||
fontconfigUltimateConf = ''
|
||||
<?xml version="1.0"?>
|
||||
<!DOCTYPE fontconfig SYSTEM "fonts.dtd">
|
||||
<fontconfig>
|
||||
|
||||
${optionalString ultimate.allowBitmaps ''
|
||||
<!-- Reject bitmap fonts -->
|
||||
<selectfont>
|
||||
<rejectfont>
|
||||
<pattern>
|
||||
<patelt name="scalable"><bool>false</bool></patelt>
|
||||
</pattern>
|
||||
</rejectfont>
|
||||
</selectfont>
|
||||
''}
|
||||
|
||||
${optionalString ultimate.allowType1 ''
|
||||
<!-- Reject Type 1 fonts -->
|
||||
<selectfont>
|
||||
<rejectfont>
|
||||
<pattern>
|
||||
<patelt name="fontformat">
|
||||
<string>Type 1</string>
|
||||
</patelt>
|
||||
</pattern>
|
||||
</rejectfont>
|
||||
</selectfont>
|
||||
''}
|
||||
|
||||
<!-- Use embedded bitmaps in fonts like Calibri? -->
|
||||
<match target="font">
|
||||
<edit name="embeddedbitmap" mode="assign">
|
||||
${fcBool ultimate.useEmbeddedBitmaps}
|
||||
</edit>
|
||||
</match>
|
||||
|
||||
<!-- Force autohint always -->
|
||||
<match target="font">
|
||||
<edit name="force_autohint" mode="assign">
|
||||
${fcBool ultimate.forceAutohint}
|
||||
</edit>
|
||||
</match>
|
||||
|
||||
<!-- Render some monospace TTF fonts as bitmaps -->
|
||||
<match target="pattern">
|
||||
<edit name="bitmap_monospace" mode="assign">
|
||||
${fcBool ultimate.renderMonoTTFAsBitmap}
|
||||
</edit>
|
||||
</match>
|
||||
|
||||
${optionalString (ultimate.substitutions != "none") ''
|
||||
<!-- Type 1 font substitutions -->
|
||||
<include ignore_missing="yes">${pkgs.fontconfig-ultimate.confd}/etc/fonts/presets/${ultimate.substitutions}</include>
|
||||
''}
|
||||
|
||||
<include ignore_missing="yes">${pkgs.fontconfig-ultimate.confd}/etc/fonts/conf.d</include>
|
||||
|
||||
</fontconfig>
|
||||
'';
|
||||
in mkIf (config.fonts.fontconfig.enable && ultimate.enable) {
|
||||
|
||||
environment.etc."fonts/conf.d/52-fontconfig-ultimate.conf" = {
|
||||
text = fontconfigUltimateConf;
|
||||
};
|
||||
|
||||
environment.etc."fonts/${pkgs.fontconfig.configVersion}/conf.d/52-fontconfig-ultimate.conf" = {
|
||||
text = fontconfigUltimateConf;
|
||||
};
|
||||
|
||||
environment.variables = ultimate.rendering;
|
||||
|
||||
};
|
||||
|
||||
}
|
@ -8,72 +8,250 @@ with lib;
|
||||
|
||||
fonts = {
|
||||
|
||||
enableFontConfig = mkOption { # !!! should be enableFontconfig
|
||||
type = types.bool;
|
||||
default = true;
|
||||
description = ''
|
||||
If enabled, a Fontconfig configuration file will be built
|
||||
pointing to a set of default fonts. If you don't care about
|
||||
running X11 applications or any other program that uses
|
||||
Fontconfig, you can turn this option off and prevent a
|
||||
dependency on all those fonts.
|
||||
'';
|
||||
fontconfig = {
|
||||
enable = mkOption {
|
||||
type = types.bool;
|
||||
default = true;
|
||||
description = ''
|
||||
If enabled, a Fontconfig configuration file will be built
|
||||
pointing to a set of default fonts. If you don't care about
|
||||
running X11 applications or any other program that uses
|
||||
Fontconfig, you can turn this option off and prevent a
|
||||
dependency on all those fonts.
|
||||
'';
|
||||
};
|
||||
|
||||
antialias = mkOption {
|
||||
type = types.bool;
|
||||
default = true;
|
||||
description = "Enable font antialiasing.";
|
||||
};
|
||||
|
||||
dpi = mkOption {
|
||||
type = types.int;
|
||||
default = 0;
|
||||
description = ''
|
||||
Force DPI setting. Setting to <literal>0</literal> disables DPI
|
||||
forcing; the DPI detected for the display will be used.
|
||||
'';
|
||||
};
|
||||
|
||||
defaultFonts = {
|
||||
monospace = mkOption {
|
||||
type = types.listOf types.str;
|
||||
default = ["DejaVu Sans Mono"];
|
||||
description = ''
|
||||
System-wide default monospace font(s). Multiple fonts may be
|
||||
listed in case multiple languages must be supported.
|
||||
'';
|
||||
};
|
||||
|
||||
sansSerif = mkOption {
|
||||
type = types.listOf types.str;
|
||||
default = ["DejaVu Sans"];
|
||||
description = ''
|
||||
System-wide default sans serif font(s). Multiple fonts may be
|
||||
listed in case multiple languages must be supported.
|
||||
'';
|
||||
};
|
||||
|
||||
serif = mkOption {
|
||||
type = types.listOf types.str;
|
||||
default = ["DejaVu Serif"];
|
||||
description = ''
|
||||
System-wide default serif font(s). Multiple fonts may be listed
|
||||
in case multiple languages must be supported.
|
||||
'';
|
||||
};
|
||||
};
|
||||
|
||||
hinting = {
|
||||
enable = mkOption {
|
||||
type = types.bool;
|
||||
default = true;
|
||||
description = "Enable TrueType hinting.";
|
||||
};
|
||||
|
||||
autohint = mkOption {
|
||||
type = types.bool;
|
||||
default = true;
|
||||
description = ''
|
||||
Enable the autohinter, which provides hinting for otherwise
|
||||
un-hinted fonts. The results are usually lower quality than
|
||||
correctly-hinted fonts.
|
||||
'';
|
||||
};
|
||||
|
||||
style = mkOption {
|
||||
type = types.str // {
|
||||
check = flip elem ["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 {
|
||||
type = types.bool;
|
||||
default = true;
|
||||
description = ''
|
||||
Include the user configuration from
|
||||
<filename>~/.config/fontconfig/fonts.conf</filename> or
|
||||
<filename>~/.config/fontconfig/conf.d</filename>.
|
||||
'';
|
||||
};
|
||||
|
||||
subpixel = {
|
||||
|
||||
rgba = mkOption {
|
||||
type = types.string // {
|
||||
check = flip elem ["rgb" "bgr" "vrgb" "vbgr" "none"];
|
||||
};
|
||||
default = "rgb";
|
||||
description = ''
|
||||
Subpixel order, one of <literal>none</literal>,
|
||||
<literal>rgb</literal>, <literal>bgr</literal>,
|
||||
<literal>vrgb</literal>, or <literal>vbgr</literal>.
|
||||
'';
|
||||
};
|
||||
|
||||
lcdfilter = mkOption {
|
||||
type = types.str // {
|
||||
check = flip elem ["none" "default" "light" "legacy"];
|
||||
};
|
||||
default = "default";
|
||||
description = ''
|
||||
FreeType LCD filter, one of <literal>none</literal>,
|
||||
<literal>default</literal>, <literal>light</literal>, or
|
||||
<literal>legacy</literal>.
|
||||
'';
|
||||
};
|
||||
|
||||
};
|
||||
|
||||
};
|
||||
|
||||
};
|
||||
|
||||
};
|
||||
|
||||
config =
|
||||
let fontconfig = config.fonts.fontconfig;
|
||||
fcBool = x: "<bool>" + (if x then "true" else "false") + "</bool>";
|
||||
nixosConf = ''
|
||||
<?xml version='1.0'?>
|
||||
<!DOCTYPE fontconfig SYSTEM 'fonts.dtd'>
|
||||
<fontconfig>
|
||||
|
||||
config = mkIf config.fonts.enableFontConfig {
|
||||
<!-- Default rendering settings -->
|
||||
<match target="font">
|
||||
<edit mode="assign" name="hinting">
|
||||
${fcBool fontconfig.hinting.enable}
|
||||
</edit>
|
||||
<edit mode="assign" name="autohint">
|
||||
${fcBool fontconfig.hinting.autohint}
|
||||
</edit>
|
||||
<edit mode="assign" name="hintstyle">
|
||||
<const>hint${fontconfig.hinting.style}</const>
|
||||
</edit>
|
||||
<edit mode="assign" name="antialias">
|
||||
${fcBool fontconfig.antialias}
|
||||
</edit>
|
||||
<edit mode="assign" name="rgba">
|
||||
<const>${fontconfig.subpixel.rgba}</const>
|
||||
</edit>
|
||||
<edit mode="assign" name="lcdfilter">
|
||||
<const>lcd${fontconfig.subpixel.lcdfilter}</const>
|
||||
</edit>
|
||||
</match>
|
||||
|
||||
# Fontconfig 2.10 backward compatibility
|
||||
<!-- Default fonts -->
|
||||
${optionalString (fontconfig.defaultFonts.sansSerif != []) ''
|
||||
<alias>
|
||||
<family>sans-serif</family>
|
||||
<prefer>
|
||||
${concatStringsSep "\n"
|
||||
(map (font: "<family>${font}</family>")
|
||||
fontconfig.defaultFonts.sansSerif)}
|
||||
</prefer>
|
||||
</alias>
|
||||
''}
|
||||
${optionalString (fontconfig.defaultFonts.serif != []) ''
|
||||
<alias>
|
||||
<family>serif</family>
|
||||
<prefer>
|
||||
${concatStringsSep "\n"
|
||||
(map (font: "<family>${font}</family>")
|
||||
fontconfig.defaultFonts.serif)}
|
||||
</prefer>
|
||||
</alias>
|
||||
''}
|
||||
${optionalString (fontconfig.defaultFonts.monospace != []) ''
|
||||
<alias>
|
||||
<family>monospace</family>
|
||||
<prefer>
|
||||
${concatStringsSep "\n"
|
||||
(map (font: "<family>${font}</family>")
|
||||
fontconfig.defaultFonts.monospace)}
|
||||
</prefer>
|
||||
</alias>
|
||||
''}
|
||||
|
||||
# Bring in the default (upstream) fontconfig configuration, only for fontconfig 2.10
|
||||
environment.etc."fonts/fonts.conf".source =
|
||||
pkgs.makeFontsConf { fontconfig = pkgs.fontconfig_210; fontDirectories = config.fonts.fonts; };
|
||||
${optionalString (fontconfig.dpi != 0) ''
|
||||
<match target="pattern">
|
||||
<edit name="dpi" mode="assign">
|
||||
<double>${fontconfig.dpi}</double>
|
||||
</edit>
|
||||
</match>
|
||||
''}
|
||||
|
||||
environment.etc."fonts/conf.d/00-nixos.conf".text =
|
||||
''
|
||||
<?xml version='1.0'?>
|
||||
<!DOCTYPE fontconfig SYSTEM 'fonts.dtd'>
|
||||
<fontconfig>
|
||||
</fontconfig>
|
||||
'';
|
||||
in mkIf fontconfig.enable {
|
||||
|
||||
<!-- Set the default hinting style to "slight". -->
|
||||
<match target="font">
|
||||
<edit mode="assign" name="hintstyle">
|
||||
<const>hintslight</const>
|
||||
</edit>
|
||||
</match>
|
||||
# Fontconfig 2.10 backward compatibility
|
||||
|
||||
</fontconfig>
|
||||
'';
|
||||
# Bring in the default (upstream) fontconfig configuration, only for fontconfig 2.10
|
||||
environment.etc."fonts/fonts.conf".source =
|
||||
pkgs.makeFontsConf { fontconfig = pkgs.fontconfig_210; fontDirectories = config.fonts.fonts; };
|
||||
|
||||
# Versioned fontconfig > 2.10. Take shared fonts.conf from fontconfig.
|
||||
# Otherwise specify only font directories.
|
||||
environment.etc."fonts/${pkgs.fontconfig.configVersion}/fonts.conf".source =
|
||||
"${pkgs.fontconfig}/etc/fonts/fonts.conf";
|
||||
environment.etc."fonts/${pkgs.fontconfig.configVersion}/conf.d/00-nixos.conf".text =
|
||||
''
|
||||
<?xml version='1.0'?>
|
||||
<!DOCTYPE fontconfig SYSTEM 'fonts.dtd'>
|
||||
<fontconfig>
|
||||
environment.etc."fonts/conf.d/98-nixos.conf".text = nixosConf;
|
||||
|
||||
<!-- Set the default hinting style to "slight". -->
|
||||
<match target="font">
|
||||
<edit mode="assign" name="hintstyle">
|
||||
<const>hintslight</const>
|
||||
</edit>
|
||||
</match>
|
||||
# Versioned fontconfig > 2.10. Take shared fonts.conf from fontconfig.
|
||||
# Otherwise specify only font directories.
|
||||
environment.etc."fonts/${pkgs.fontconfig.configVersion}/fonts.conf".source =
|
||||
"${pkgs.fontconfig}/etc/fonts/fonts.conf";
|
||||
|
||||
<!-- Font directories -->
|
||||
${concatStringsSep "\n" (map (font: "<dir>${font}</dir>") config.fonts.fonts)}
|
||||
environment.etc."fonts/${pkgs.fontconfig.configVersion}/conf.d/00-nixos.conf".text =
|
||||
''
|
||||
<?xml version='1.0'?>
|
||||
<!DOCTYPE fontconfig SYSTEM 'fonts.dtd'>
|
||||
<fontconfig>
|
||||
<!-- Font directories -->
|
||||
${concatStringsSep "\n" (map (font: "<dir>${font}</dir>") config.fonts.fonts)}
|
||||
</fontconfig>
|
||||
'';
|
||||
|
||||
</fontconfig>
|
||||
'';
|
||||
environment.etc."fonts/${pkgs.fontconfig.configVersion}/conf.d/98-nixos.conf".text = nixosConf;
|
||||
|
||||
environment.systemPackages = [ pkgs.fontconfig ];
|
||||
environment.etc."fonts/${pkgs.fontconfig.configVersion}/conf.d/99-user.conf" = {
|
||||
enable = fontconfig.includeUserConf;
|
||||
text = ''
|
||||
<?xml version="1.0"?>
|
||||
<!DOCTYPE fontconfig SYSTEM "fonts.dtd">
|
||||
<fontconfig>
|
||||
<include ignore_missing="yes" prefix="xdg">fontconfig/conf.d</include>
|
||||
<include ignore_missing="yes" prefix="xdg">fontconfig/fonts.conf</include>
|
||||
</fontconfig>
|
||||
'';
|
||||
};
|
||||
|
||||
};
|
||||
environment.systemPackages = [ pkgs.fontconfig ];
|
||||
|
||||
};
|
||||
|
||||
}
|
||||
|
@ -25,7 +25,7 @@ with lib;
|
||||
[ pkgs.xorg.fontbhttf
|
||||
pkgs.xorg.fontbhlucidatypewriter100dpi
|
||||
pkgs.xorg.fontbhlucidatypewriter75dpi
|
||||
pkgs.ttf_bitstream_vera
|
||||
pkgs.dejavu_fonts
|
||||
pkgs.freefont_ttf
|
||||
pkgs.liberation_ttf
|
||||
pkgs.xorg.fontbh100dpi
|
||||
|
@ -24,7 +24,7 @@ with lib;
|
||||
programs.ssh.setXAuthLocation = false;
|
||||
security.pam.services.su.forwardXAuth = lib.mkForce false;
|
||||
|
||||
fonts.enableFontConfig = false;
|
||||
fonts.fontconfig.enable = false;
|
||||
|
||||
nixpkgs.config.packageOverrides = pkgs:
|
||||
{ dbus = pkgs.dbus.override { useX11 = false; }; };
|
||||
|
@ -1,6 +1,7 @@
|
||||
[
|
||||
./config/fonts/corefonts.nix
|
||||
./config/fonts/fontconfig.nix
|
||||
./config/fonts/fontconfig-ultimate.nix
|
||||
./config/fonts/fontdir.nix
|
||||
./config/fonts/fonts.nix
|
||||
./config/fonts/ghostscript.nix
|
||||
|
@ -74,6 +74,7 @@ in zipModules ([]
|
||||
++ obsolete [ "environment" "x11Packages" ] [ "environment" "systemPackages" ]
|
||||
++ obsolete [ "environment" "enableBashCompletion" ] [ "programs" "bash" "enableCompletion" ]
|
||||
++ obsolete [ "environment" "nix" ] [ "nix" "package" ]
|
||||
++ obsolete [ "fonts" "enableFontConfig" ] [ "fonts" "fontconfig" "enable" ]
|
||||
++ obsolete [ "fonts" "extraFonts" ] [ "fonts" "fonts" ]
|
||||
|
||||
++ obsolete [ "security" "extraSetuidPrograms" ] [ "security" "setuidPrograms" ]
|
||||
|
@ -23,6 +23,17 @@ let
|
||||
pathsToLink = [ "/" ];
|
||||
};
|
||||
|
||||
fontconfig = config.fonts.fontconfig;
|
||||
xresourcesXft = pkgs.writeText "Xresources-Xft" ''
|
||||
${optionalString (fontconfig.dpi != 0) ''Xft.dpi: ${fontconfig.dpi}''}
|
||||
Xft.antialias: ${if fontconfig.antialias then "1" else "0"}
|
||||
Xft.rgba: ${fontconfig.subpixel.rgba}
|
||||
Xft.lcdfilter: lcd${fontconfig.subpixel.lcdfilter}
|
||||
Xft.hinting: ${if fontconfig.hinting.enable then "1" else "0"}
|
||||
Xft.autohint: ${if fontconfig.hinting.autohint then "1" else "0"}
|
||||
Xft.hintstyle: hint${fontconfig.hinting.style}
|
||||
'';
|
||||
|
||||
# file provided by services.xserver.displayManager.session.script
|
||||
xsession = wm: dm: pkgs.writeScript "xsession"
|
||||
''
|
||||
@ -79,6 +90,7 @@ let
|
||||
''}
|
||||
|
||||
# Load X defaults.
|
||||
${xorg.xrdb}/bin/xrdb -merge ${xresourcesXft}
|
||||
if test -e ~/.Xresources; then
|
||||
${xorg.xrdb}/bin/xrdb -merge ~/.Xresources
|
||||
elif test -e ~/.Xdefaults; then
|
||||
|
33
pkgs/development/libraries/fontconfig-ultimate/confd.nix
Normal file
33
pkgs/development/libraries/fontconfig-ultimate/confd.nix
Normal file
@ -0,0 +1,33 @@
|
||||
{ stdenv, fetchurl }:
|
||||
|
||||
stdenv.mkDerivation {
|
||||
name = "fontconfig-ultimate-20141123";
|
||||
src = fetchurl {
|
||||
url = "https://github.com/bohoomil/fontconfig-ultimate/archive/2014-11-23.tar.gz";
|
||||
sha256 = "0czfm3hxc41x5mscwrba7p1vhm2w62j1qg7z8kfdrf21z8fvgznw";
|
||||
};
|
||||
|
||||
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/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/97-local.conf
|
||||
rm $out/etc/fonts/conf.d/98-user.conf
|
||||
|
||||
cp fontconfig_patches/fonts-settings/*.conf $out/etc/fonts/conf.d
|
||||
|
||||
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
|
||||
'';
|
||||
}
|
@ -0,0 +1,6 @@
|
||||
{ callPackage }:
|
||||
|
||||
{
|
||||
confd = callPackage ./confd.nix {};
|
||||
rendering = callPackage ./rendering.nix {};
|
||||
}
|
212
pkgs/development/libraries/fontconfig-ultimate/rendering.nix
Normal file
212
pkgs/development/libraries/fontconfig-ultimate/rendering.nix
Normal file
@ -0,0 +1,212 @@
|
||||
{}:
|
||||
|
||||
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";
|
||||
};
|
||||
}
|
@ -27,8 +27,6 @@
|
||||
<include><xsl:value-of select="$fontconfig" />/etc/fonts/conf.d</include>
|
||||
<!-- versioned system-wide config -->
|
||||
<include ignore_missing="yes">/etc/fonts/<xsl:value-of select="$fontconfigConfigVersion" />/conf.d</include>
|
||||
<!-- look into user config -->
|
||||
<include prefix="xdg" ignore_missing="yes">fontconfig/conf.d</include>
|
||||
|
||||
<!-- the first cachedir will be used to store the cache -->
|
||||
<cachedir prefix="xdg">fontconfig</cachedir>
|
||||
|
@ -5168,6 +5168,8 @@ let
|
||||
|
||||
fontconfig = callPackage ../development/libraries/fontconfig { };
|
||||
|
||||
fontconfig-ultimate = callPackage ../development/libraries/fontconfig-ultimate {};
|
||||
|
||||
folly = callPackage ../development/libraries/folly { };
|
||||
|
||||
makeFontsConf = let fontconfig_ = fontconfig; in {fontconfig ? fontconfig_, fontDirectories}:
|
||||
|
Loading…
Reference in New Issue
Block a user