From e70a928d674fee7c7d3da2678de8e24126c680a8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Charlotte=20=F0=9F=A6=9D=20Delenk?= Date: Sun, 25 Sep 2022 18:21:17 +0100 Subject: [PATCH] add kreative fonts --- default.nix | 5 ++++ fonts/kreative.nix | 48 ------------------------------ fonts/kreative/alco-sans.nix | 21 +++++++++++++ fonts/kreative/constructium.nix | 21 +++++++++++++ fonts/kreative/fairfax-hd.nix | 28 +++++++++++++++++ fonts/kreative/fairfax.nix | 23 ++++++++++++++ fonts/kreative/kreative-square.nix | 23 ++++++++++++++ fonts/kreative/source.json | 11 +++++++ fonts/kreative/source.nix | 8 +++++ 9 files changed, 140 insertions(+), 48 deletions(-) delete mode 100644 fonts/kreative.nix create mode 100644 fonts/kreative/alco-sans.nix create mode 100644 fonts/kreative/constructium.nix create mode 100644 fonts/kreative/fairfax-hd.nix create mode 100644 fonts/kreative/fairfax.nix create mode 100644 fonts/kreative/kreative-square.nix create mode 100644 fonts/kreative/source.json create mode 100644 fonts/kreative/source.nix diff --git a/default.nix b/default.nix index 3d7d333..24b32e0 100644 --- a/default.nix +++ b/default.nix @@ -24,4 +24,9 @@ emoji-volpeon-vlpn = pkgs.callPackage ./art/emoji/volpeon/vlpn.nix {}; lotte-art = pkgs.callPackage ./art/lotte {}; drone-runner-docker = pkgs.callPackage ./ci/drone-runner-docker {}; + alco-sans = pkgs.callPackage ./fonts/kreative/alco-sans.nix {}; + constructium = pkgs.callPackage ./fonts/kreative/constructium.nix {}; + fairfax = pkgs.callPackage ./fonts/kreative/fairfax.nix {}; + fairfax-hd = pkgs.callPackage ./fonts/kreative/fairfax-hd.nix {}; + kreative-square = pkgs.callPackage ./fonts/kreative/kreative-square.nix {}; } diff --git a/fonts/kreative.nix b/fonts/kreative.nix deleted file mode 100644 index be01610..0000000 --- a/fonts/kreative.nix +++ /dev/null @@ -1,48 +0,0 @@ -{ - inputs, - pkgs, - ... -}: let - open-relay = inputs.kreative-open-relay; - - fonts = - [ - { - name = "alco-sans"; - path = "AlcoSans/AlcoSans"; - } - { - name = "constructium"; - path = "Constructium/Constructium"; - } - { - name = "fairfax-hd"; - path = "FairfaxHD/FairfaxHD"; - } - { - name = "fairfax-hax-hd"; - path = "FairfaxHD/FairfaxHaxHD"; - } - { - name = "fairfax-sm-hd"; - path = "FairfaxHD/FairfaxSMHD"; - } - ] - ++ (map (x: { - name = "fairfax-${pkgs.lib.strings.toLower x}"; - path = "Fairfax/Fairfax${x}"; - }) ["" "Bold" "Italic" "SM" "SMBold" "SMItalic" "Serif" "SerifSM"]); -in - builtins.listToAttrs (map (v: { - inherit (v) name; - value = pkgs.stdenvNoCC.mkDerivation { - pname = v.name; - version = open-relay.lastModifiedDate; - src = open-relay; - buildPhase = "true"; - installPhase = '' - install -m444 -Dt $out/share/truetype/${v.name} ${v.path}.ttf - ''; - }; - }) - fonts) diff --git a/fonts/kreative/alco-sans.nix b/fonts/kreative/alco-sans.nix new file mode 100644 index 0000000..617bdad --- /dev/null +++ b/fonts/kreative/alco-sans.nix @@ -0,0 +1,21 @@ +{ + stdenv, + callPackage, + lib, +}: let + source = builtins.fromJSON (builtins.readFile ./source.json); +in + stdenv.mkDerivation { + name = "alco-sans"; + version = source.date; + src = callPackage ./source.nix {}; + preferLocalBuild = true; + buildPhase = "true"; + installPhase = '' + install -m444 -Dt $out/share/truetype/AlcoSans AlcoSans/AlcoSans.ttf + ''; + meta = { + description = "Font by Kreative Software"; + license = lib.licenses.ofl; + }; + } diff --git a/fonts/kreative/constructium.nix b/fonts/kreative/constructium.nix new file mode 100644 index 0000000..2c5b769 --- /dev/null +++ b/fonts/kreative/constructium.nix @@ -0,0 +1,21 @@ +{ + stdenv, + callPackage, + lib, +}: let + source = builtins.fromJSON (builtins.readFile ./source.json); +in + stdenv.mkDerivation { + name = "constructium"; + version = source.date; + src = callPackage ./source.nix {}; + preferLocalBuild = true; + buildPhase = "true"; + installPhase = '' + install -m444 -Dt $out/share/truetype/Constructium Constructium/Constructium.ttf + ''; + meta = { + description = "Fork of SIL Gentium with glyph for Constructed Languages"; + license = lib.licenses.ofl; + }; + } diff --git a/fonts/kreative/fairfax-hd.nix b/fonts/kreative/fairfax-hd.nix new file mode 100644 index 0000000..72adecd --- /dev/null +++ b/fonts/kreative/fairfax-hd.nix @@ -0,0 +1,28 @@ +{ + stdenv, + callPackage, + lib, +}: let + source = builtins.fromJSON (builtins.readFile ./source.json); +in + stdenv.mkDerivation { + name = "fairfax-hd"; + version = source.date; + src = callPackage ./source.nix {}; + preferLocalBuild = true; + buildPhase = "true"; + installPhase = '' + for variant in HD HaxHD PonaHD SMHD; do + install -m444 -Dt $out/share/truetype/FairfaxHD FairfaxHD/Fairfax$variant.ttf + done + ''; + meta = { + description = "Halfwidth scalable monospace font with support for many scripts, including Conscripts"; + license = lib.licenses.ofl; + }; + passthru.updateScript = [ + ../../scripts/update-git.sh + "https://gitlab.com/kreativekorp/open-relay.git" + "fonts/kreative/source.json" + ]; + } diff --git a/fonts/kreative/fairfax.nix b/fonts/kreative/fairfax.nix new file mode 100644 index 0000000..cea4661 --- /dev/null +++ b/fonts/kreative/fairfax.nix @@ -0,0 +1,23 @@ +{ + stdenv, + callPackage, + lib, +}: let + source = builtins.fromJSON (builtins.readFile ./source.json); +in + stdenv.mkDerivation { + name = "fairfax"; + version = source.date; + src = callPackage ./source.nix {}; + preferLocalBuild = true; + buildPhase = "true"; + installPhase = '' + for variant in "" Bold Hax HaxBold HaxItalic Italic Pona SM SMBold SMItalic Serif SerifHax SerifSM; do + install -m444 -Dt $out/share/truetype/Fairfax Fairfax/Fairfax$variant.ttf + done + ''; + meta = { + description = "6x12 Bitmap Font supporting many Unicode Characters and Constructed Scripts"; + license = lib.licenses.ofl; + }; + } diff --git a/fonts/kreative/kreative-square.nix b/fonts/kreative/kreative-square.nix new file mode 100644 index 0000000..3d3f769 --- /dev/null +++ b/fonts/kreative/kreative-square.nix @@ -0,0 +1,23 @@ +{ + stdenv, + callPackage, + lib, +}: let + source = builtins.fromJSON (builtins.readFile ./source.json); +in + stdenv.mkDerivation { + name = "kreative-square"; + version = source.date; + src = callPackage ./source.nix {}; + preferLocalBuild = true; + buildPhase = "true"; + installPhase = '' + for variant in "" SM; do + install -m444 -Dt $out/share/truetype/KreativeSquare KreativeSquare/$variant.ttf + done + ''; + meta = { + description = "Fullwidth scalable monospace font with many Box Drawing characters"; + license = lib.licenses.ofl; + }; + } diff --git a/fonts/kreative/source.json b/fonts/kreative/source.json new file mode 100644 index 0000000..e953cdc --- /dev/null +++ b/fonts/kreative/source.json @@ -0,0 +1,11 @@ +{ + "url": "https://gitlab.com/kreativekorp/open-relay.git", + "rev": "cbaca8d9d6d65bddbc05dd3e20b7063639f6664a", + "date": "2022-09-04T21:11:08-07:00", + "path": "/nix/store/3s07242jw2iy6v96fhdnsq6yr3zl8mkv-open-relay", + "sha256": "1k5ymzh73q8pkn8jssiif5p9vm3k84h5nd3m0j9mgb0gf85gapw1", + "fetchLFS": false, + "fetchSubmodules": false, + "deepClone": false, + "leaveDotGit": false +} diff --git a/fonts/kreative/source.nix b/fonts/kreative/source.nix new file mode 100644 index 0000000..7c41410 --- /dev/null +++ b/fonts/kreative/source.nix @@ -0,0 +1,8 @@ +{fetchFromGitLab}: let + source = builtins.fromJSON (builtins.readFile ./source.json); +in + fetchFromGitLab { + owner = "kreativekorp"; + repo = "openrelay"; + inherit (source) rev sha256; + }