Convert gg sans to ttf
This commit is contained in:
parent
a5002a6881
commit
5345a28290
12
flake.lock
12
flake.lock
|
@ -5,11 +5,11 @@
|
||||||
"systems": "systems"
|
"systems": "systems"
|
||||||
},
|
},
|
||||||
"locked": {
|
"locked": {
|
||||||
"lastModified": 1692799911,
|
"lastModified": 1701680307,
|
||||||
"narHash": "sha256-3eihraek4qL744EvQXsK1Ha6C3CR7nnT8X2qWap4RNk=",
|
"narHash": "sha256-kAuep2h5ajznlPMD9rnQyffWG8EM/C73lejGofXvdM8=",
|
||||||
"owner": "numtide",
|
"owner": "numtide",
|
||||||
"repo": "flake-utils",
|
"repo": "flake-utils",
|
||||||
"rev": "f9e7cf818399d17d347f847525c5a5a8032e4e44",
|
"rev": "4022d587cbbfd70fe950c1e2083a02621806a725",
|
||||||
"type": "github"
|
"type": "github"
|
||||||
},
|
},
|
||||||
"original": {
|
"original": {
|
||||||
|
@ -20,11 +20,11 @@
|
||||||
},
|
},
|
||||||
"nixpkgs": {
|
"nixpkgs": {
|
||||||
"locked": {
|
"locked": {
|
||||||
"lastModified": 1694310981,
|
"lastModified": 1702840599,
|
||||||
"narHash": "sha256-Rf6ICXzUXfi2ILwEggBJMmVVR06AKS5DMcXZd1qi24o=",
|
"narHash": "sha256-jjWgSOWriN0fJ/uh3kkKzQjb9O21GdTsfDo1JVg75Xg=",
|
||||||
"owner": "nixos",
|
"owner": "nixos",
|
||||||
"repo": "nixpkgs",
|
"repo": "nixpkgs",
|
||||||
"rev": "49772c4112bf70d28086b459d31710408745f842",
|
"rev": "b425dc72ad3eb4d71524c0af237fcc7a728247f6",
|
||||||
"type": "github"
|
"type": "github"
|
||||||
},
|
},
|
||||||
"original": {
|
"original": {
|
||||||
|
|
66
flake.nix
66
flake.nix
|
@ -5,48 +5,42 @@
|
||||||
nixpkgs.url = "github:nixos/nixpkgs";
|
nixpkgs.url = "github:nixos/nixpkgs";
|
||||||
};
|
};
|
||||||
|
|
||||||
outputs = {
|
outputs = { self, nixpkgs, flake-utils, }:
|
||||||
self,
|
|
||||||
nixpkgs,
|
|
||||||
flake-utils,
|
|
||||||
}:
|
|
||||||
with builtins;
|
with builtins;
|
||||||
with nixpkgs.lib;
|
with nixpkgs.lib;
|
||||||
flake-utils.lib.eachDefaultSystem (system: let
|
flake-utils.lib.eachDefaultSystem (system:
|
||||||
|
let
|
||||||
pkgs = import nixpkgs {
|
pkgs = import nixpkgs {
|
||||||
inherit system;
|
inherit system;
|
||||||
config.allowUnfree = true;
|
config.allowUnfree = true;
|
||||||
};
|
};
|
||||||
|
|
||||||
pathEndsWith = suffix: path: let
|
pathEndsWith = suffix: path:
|
||||||
str = toString path;
|
let
|
||||||
sufLen = stringLength suffix;
|
str = toString path;
|
||||||
sLen = stringLength str;
|
sufLen = stringLength suffix;
|
||||||
in
|
sLen = stringLength str;
|
||||||
sufLen <= sLen && suffix == substring (sLen - sufLen) sufLen str;
|
in sufLen <= sLen && suffix == substring (sLen - sufLen) sufLen str;
|
||||||
|
|
||||||
buildFont = {
|
buildFont = { name, files, license, author, }:
|
||||||
name,
|
let
|
||||||
files,
|
copyType = extension: pathName:
|
||||||
license,
|
let
|
||||||
author,
|
filteredFiles = filter (pathEndsWith ("." + extension)) files;
|
||||||
}: let
|
filename = file:
|
||||||
copyType = extension: pathName: let
|
lists.last (strings.splitString "/" (toString file));
|
||||||
filteredFiles = filter (pathEndsWith ("." + extension)) files;
|
in (optionalString (filteredFiles != [ ]) ''
|
||||||
filename = file: lists.last (strings.splitString "/" (toString file));
|
mkdir -p $out/share/fonts/${pathName}
|
||||||
in
|
'') + concatStringsSep "\n" (map (file:
|
||||||
(optionalString (filteredFiles != []) "mkdir -p $out/share/fonts/${pathName}\n")
|
"cp -v ${file} $out/share/fonts/${pathName}/${filename file}")
|
||||||
+ concatStringsSep "\n" (map (file: "cp -v ${file} $out/share/fonts/${pathName}/${filename file}")
|
filteredFiles);
|
||||||
filteredFiles);
|
in pkgs.stdenvNoCC.mkDerivation {
|
||||||
in
|
|
||||||
pkgs.stdenvNoCC.mkDerivation {
|
|
||||||
inherit name;
|
inherit name;
|
||||||
|
|
||||||
dontUnpack = true;
|
dontUnpack = true;
|
||||||
installPhase = ''
|
installPhase = ''
|
||||||
${copyType "ttf" "truetype"}
|
${copyType "ttf" "truetype"}
|
||||||
${copyType "otf" "opentype"}
|
${copyType "otf" "opentype"}
|
||||||
${copyType "woff2" "woff2"}
|
|
||||||
'';
|
'';
|
||||||
|
|
||||||
meta = {
|
meta = {
|
||||||
|
@ -59,30 +53,30 @@
|
||||||
fonts = [
|
fonts = [
|
||||||
{
|
{
|
||||||
name = "OCR-B";
|
name = "OCR-B";
|
||||||
files = [./OCR-B-Regular.otf];
|
files = [ ./OCR-B-Regular.otf ];
|
||||||
license = licenses.cc-by-40;
|
license = licenses.cc-by-40;
|
||||||
author = "Matthew Anderson";
|
author = "Matthew Anderson";
|
||||||
}
|
}
|
||||||
{
|
{
|
||||||
name = "gg sans";
|
name = "gg sans";
|
||||||
files = [./ggsans-Normal.woff2 ./ggsans-Medium.woff2 ./ggsans-SemiBold.woff2];
|
files =
|
||||||
|
[ ./ggsans-Normal.ttf ./ggsans-Medium.ttf ./ggsans-SemiBold.ttf ];
|
||||||
license = licenses.unfree;
|
license = licenses.unfree;
|
||||||
author = "Colophon Foundry";
|
author = "Colophon Foundry";
|
||||||
}
|
}
|
||||||
{
|
{
|
||||||
name = "Caveat";
|
name = "Caveat";
|
||||||
files = [./Caveat.ttf];
|
files = [ ./Caveat.ttf ];
|
||||||
license = licenses.ofl;
|
license = licenses.ofl;
|
||||||
author = "Pablo Impallari and Alexi Vanyashin";
|
author = "Pablo Impallari and Alexi Vanyashin";
|
||||||
}
|
}
|
||||||
];
|
];
|
||||||
in {
|
in {
|
||||||
packages = listToAttrs (map (font: {
|
packages = listToAttrs (map (font: {
|
||||||
name = replaceStrings [" "] ["-"] (toLower font.name);
|
name = replaceStrings [ " " ] [ "-" ] (toLower font.name);
|
||||||
value = buildFont font;
|
value = buildFont font;
|
||||||
})
|
}) fonts);
|
||||||
fonts);
|
|
||||||
|
|
||||||
formatter = pkgs.alejandra;
|
formatter = pkgs.nixfmt;
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
BIN
ggsans-Medium.ttf
Normal file
BIN
ggsans-Medium.ttf
Normal file
Binary file not shown.
Binary file not shown.
BIN
ggsans-Normal.ttf
Normal file
BIN
ggsans-Normal.ttf
Normal file
Binary file not shown.
Binary file not shown.
BIN
ggsans-SemiBold.ttf
Normal file
BIN
ggsans-SemiBold.ttf
Normal file
Binary file not shown.
Binary file not shown.
Loading…
Reference in a new issue