Add caveat, just use original filename because of variable fonts

This commit is contained in:
Artemis Tosini 2023-09-10 05:16:58 +00:00
parent 4013f8df73
commit a5002a6881
Signed by: artemist
GPG key ID: EE5227935FE3FF18
2 changed files with 8 additions and 4 deletions

BIN
Caveat.ttf Normal file

Binary file not shown.

View file

@ -33,12 +33,10 @@
}: let }: let
copyType = extension: pathName: let copyType = extension: pathName: let
filteredFiles = filter (pathEndsWith ("." + extension)) files; filteredFiles = filter (pathEndsWith ("." + extension)) files;
filename = file: lists.last (strings.splitString "/" (toString file));
in in
(optionalString (filteredFiles != []) "mkdir -p $out/share/fonts/${pathName}\n") (optionalString (filteredFiles != []) "mkdir -p $out/share/fonts/${pathName}\n")
+ concatStringsSep "\n" (map (file: '' + concatStringsSep "\n" (map (file: "cp -v ${file} $out/share/fonts/${pathName}/${filename file}")
filename=$(${pkgs.fontconfig}/bin/fc-query -f %{postscriptname} ${file}).${extension}
cp -v ${file} $out/share/fonts/${pathName}/$filename
'')
filteredFiles); filteredFiles);
in in
pkgs.stdenvNoCC.mkDerivation { pkgs.stdenvNoCC.mkDerivation {
@ -71,6 +69,12 @@
license = licenses.unfree; license = licenses.unfree;
author = "Colophon Foundry"; author = "Colophon Foundry";
} }
{
name = "Caveat";
files = [./Caveat.ttf];
license = licenses.ofl;
author = "Pablo Impallari and Alexi Vanyashin";
}
]; ];
in { in {
packages = listToAttrs (map (font: { packages = listToAttrs (map (font: {