From 3326958e6826b3d31e4342e9f2f993d51bba8410 Mon Sep 17 00:00:00 2001 From: Burgess Chang Date: Wed, 14 Aug 2024 18:25:33 +0800 Subject: [PATCH] feat: initial alibaba-puhuiti Signed-off-by: Burgess Chang --- doc/src/fonts/overlays/proprius-fonts.md | 4 ++ .../overlays/alibaba-puhuiti/package.nix | 42 +++++++++++++++++++ nix/fonts/overlays/default.nix | 2 + nix/fonts/packages/default.nix | 2 + 4 files changed, 50 insertions(+) create mode 100644 nix/fonts/overlays/alibaba-puhuiti/package.nix diff --git a/doc/src/fonts/overlays/proprius-fonts.md b/doc/src/fonts/overlays/proprius-fonts.md index 57d4d1ec..fbefb94e 100644 --- a/doc/src/fonts/overlays/proprius-fonts.md +++ b/doc/src/fonts/overlays/proprius-fonts.md @@ -94,6 +94,10 @@ Return a list of font derivation from a given list of font derivations that grat ## Packages +### `pkgs.alibaba-puhuiti` + +An Chinese font gratis propria commercium, design by Alibaba. + ### `pkgs.foundertype-fonts` This is a part of the foudertype fonts, only includes the fonts required by the CTeX `founder` fontset. You need to obtain the authorization to use the font at before installation, and strictly comply with the FounderType Home Edition User License Agreement [^1]. diff --git a/nix/fonts/overlays/alibaba-puhuiti/package.nix b/nix/fonts/overlays/alibaba-puhuiti/package.nix new file mode 100644 index 00000000..502bc9a4 --- /dev/null +++ b/nix/fonts/overlays/alibaba-puhuiti/package.nix @@ -0,0 +1,42 @@ +{ + fetchzip, + lib, + stdenvNoCC, +}: +let + alibaba-puhuiti-license = { + free = false; + fullName = "《阿里巴巴普惠体3.0版》法律声明"; + redistributable = true; + shortName = "alibaba-puhuiti-license"; + url = "https://www.yuque.com/yiguang-wkqc2/puhuiti/nus9wiinq4aeiegy"; + }; +in +stdenvNoCC.mkDerivation { + pname = "alibaba-puhuiti"; + version = "3.0"; + + src = fetchzip { + hash = "sha256-7ZmurN+sC3binkhABG588Tdvz7KLc06+UvK5TOTjqvY="; + stripRoot = false; + url = "https://puhuiti.oss-cn-hangzhou.aliyuncs.com/AlibabaPuHuiTi-3.zip"; + }; + + installPhase = '' + runHook preInstall + + mkdir -p $out/share/fonts/truetype + + cp -r $src/AlibabaPuHuiTi-3 $out/share/fonts/truetype/ + + runHook postInstall + ''; + + meta = with lib; { + homepage = "https://www.alibabafonts.com"; + description = "An Chinese font gratis propria commercium"; + license = alibaba-puhuiti-license; + platforms = platforms.all; + maintainers = with maintainers; [ brsvh ]; + }; +} diff --git a/nix/fonts/overlays/default.nix b/nix/fonts/overlays/default.nix index 1c6ce165..9439fb46 100644 --- a/nix/fonts/overlays/default.nix +++ b/nix/fonts/overlays/default.nix @@ -5,6 +5,8 @@ inherit (prev) callPackage; in { + alibaba-puhuiti = callPackage ./alibaba-puhuiti/package.nix { }; + foundertype-fonts = callPackage ./foundertype-fonts/package.nix { }; tsangertypeFonts = callPackage ./tsangertype-fonts/package.nix { }; diff --git a/nix/fonts/packages/default.nix b/nix/fonts/packages/default.nix index ed75d7fc..bfdb8064 100644 --- a/nix/fonts/packages/default.nix +++ b/nix/fonts/packages/default.nix @@ -5,6 +5,8 @@ let pkgs = nixpkgs.appendOverlays [ cell.overlays.proprius-fonts ]; in { + alibaba-puhuiti = pkgs.alibaba-puhuiti; + foundertype-fonts = pkgs.foundertype-fonts; tsangertype-fonts = pkgs.tsangertypeFonts.gratisProPersona;