From a5618e6187d272b4c498696a53e4bef9df68e45c Mon Sep 17 00:00:00 2001 From: Emilio Perez Date: Sun, 30 Aug 2020 21:39:27 +0100 Subject: [PATCH] nixos/fontdir: gather more font formats - Fix wrong order in which font indexes are created mkfontdir requires the file fonts.scale to consider scalable fonts, thus, mkfontscale should be run before - Search more font formats, in particular, bit-mapped formats --- nixos/modules/config/fonts/fontdir.nix | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/nixos/modules/config/fonts/fontdir.nix b/nixos/modules/config/fonts/fontdir.nix index a6aa84ae8224..45d821e7e883 100644 --- a/nixos/modules/config/fonts/fontdir.nix +++ b/nixos/modules/config/fonts/fontdir.nix @@ -5,14 +5,16 @@ with lib; let x11Fonts = pkgs.runCommand "X11-fonts" { preferLocalBuild = true; } '' + font_formats=('ttf' 'otf' 'pcf' 'pfa' 'pfb' 'bdf') mkdir -p "$out/share/X11-fonts" - find ${toString config.fonts.fonts} \ - \( -name fonts.dir -o -name '*.ttf' -o -name '*.otf' \) \ - -exec ln -sf -t "$out/share/X11-fonts" '{}' \; + for fmt in "''${font_formats[@]}"; do + find ${toString config.fonts.fonts} \ + \( -name '*.'$fmt -o -name '*.'$fmt'.gz' \) \ + -exec ln -sf -t "$out/share/X11-fonts" '{}' \; + done cd "$out/share/X11-fonts" - rm -f fonts.dir fonts.scale fonts.alias - ${pkgs.xorg.mkfontdir}/bin/mkfontdir ${pkgs.xorg.mkfontscale}/bin/mkfontscale + ${pkgs.xorg.mkfontdir}/bin/mkfontdir cat $(find ${pkgs.xorg.fontalias}/ -name fonts.alias) >fonts.alias '';