From fbe6137a0d773bb44e6f92129a4995eae2e12b03 Mon Sep 17 00:00:00 2001 From: jopejoe1 Date: Sat, 8 Apr 2023 21:56:32 +0200 Subject: [PATCH 1/2] noto-fonts: 20201206-phase3 -> 23.4.1 --- pkgs/data/fonts/noto-fonts/default.nix | 26 ++++++++------------------ 1 file changed, 8 insertions(+), 18 deletions(-) diff --git a/pkgs/data/fonts/noto-fonts/default.nix b/pkgs/data/fonts/noto-fonts/default.nix index b3e4d7d67bce..abd6ad0b2c31 100644 --- a/pkgs/data/fonts/noto-fonts/default.nix +++ b/pkgs/data/fonts/noto-fonts/default.nix @@ -24,8 +24,6 @@ let Google’s answer to tofu. The name noto is to convey the idea that Google’s goal is to see “no more tofu”. Noto has multiple styles and weights, and freely available to all. - - This package also includes the Arimo, Cousine, and Tinos fonts. ''; in rec { @@ -37,13 +35,13 @@ rec { }: stdenvNoCC.mkDerivation rec { inherit pname; - version = "20201206-phase3"; + version = "23.4.1"; src = fetchFromGitHub { - owner = "googlefonts"; - repo = "noto-fonts"; - rev = "v${version}"; - hash = "sha256-x60RvCRFLoGe0CNvswROnDkIsUFbWH+/laN8q2qkUPk="; + owner = "notofonts"; + repo = "notofonts.github.io"; + rev = "noto-monthly-release-${version}"; + hash = "sha256-hiBbhcwktacuoYJnZcsh7Aej5QIrBNkqrel2NhjNjCU="; }; _variants = map (variant: builtins.replaceStrings [ " " ] [ "" ] variant) variants; @@ -56,16 +54,10 @@ rec { # TODO: install OpenType, variable versions? local out_ttf=$out/share/fonts/truetype/noto '' + (if _variants == [ ] then '' - install -m444 -Dt $out_ttf archive/unhinted/*/*-${weights}.ttf - install -m444 -Dt $out_ttf archive/hinted/*/*-${weights}.ttf - install -m444 -Dt $out_ttf unhinted/*/*/*-${weights}.ttf - install -m444 -Dt $out_ttf hinted/*/*/*-${weights}.ttf + install -m444 -Dt $out_ttf fonts/*/hinted/ttf/*-${weights}.ttf '' else '' for variant in $_variants; do - install -m444 -Dt $out_ttf archive/unhinted/$variant/*-${weights}.ttf - install -m444 -Dt $out_ttf archive/hinted/$variant/*-${weights}.ttf - install -m444 -Dt $out_ttf unhinted/*/$variant/*-${weights}.ttf - install -m444 -Dt $out_ttf hinted/*/$variant/*-${weights}.ttf + install -m444 -Dt $out_ttf fonts/$variant/hinted/ttf/*-${weights}.ttf done ''); @@ -75,7 +67,7 @@ rec { inherit longDescription; license = licenses.ofl; platforms = platforms.all; - maintainers = with maintainers; [ mathnerd314 emily ]; + maintainers = with maintainers; [ mathnerd314 emily jopejoe1 ]; }; }; @@ -129,8 +121,6 @@ rec { variants = [ "Noto Sans" "Noto Serif" - "Noto Sans Display" - "Noto Serif Display" "Noto Sans Mono" "Noto Music" "Noto Sans Symbols" From c347bd62a16ba88322be96cf733f7c49d7988afc Mon Sep 17 00:00:00 2001 From: jopejoe1 Date: Sat, 8 Apr 2023 22:08:04 +0200 Subject: [PATCH 2/2] noto-fonts: switch to variable fonts and remove noto-font-extra --- pkgs/data/fonts/noto-fonts/default.nix | 34 +++++++++++++++----------- pkgs/top-level/aliases.nix | 1 + pkgs/top-level/all-packages.nix | 3 +-- 3 files changed, 22 insertions(+), 16 deletions(-) diff --git a/pkgs/data/fonts/noto-fonts/default.nix b/pkgs/data/fonts/noto-fonts/default.nix index abd6ad0b2c31..822bde41abe3 100644 --- a/pkgs/data/fonts/noto-fonts/default.nix +++ b/pkgs/data/fonts/noto-fonts/default.nix @@ -29,7 +29,6 @@ in rec { mkNoto = { pname - , weights , variants ? [ ] , longDescription ? notoLongDescription }: @@ -47,17 +46,31 @@ rec { _variants = map (variant: builtins.replaceStrings [ " " ] [ "" ] variant) variants; installPhase = '' - # We copy in reverse preference order -- unhinted first, then - # hinted -- to get the "best" version of each font while + # We check availability in order of variable -> otf -> ttf + # unhinted -- the hinted versions use autohint # maintaining maximum coverage. # - # TODO: install OpenType, variable versions? - local out_ttf=$out/share/fonts/truetype/noto + # We have a mix of otf and ttf fonts + local out_font=$out/share/fonts/noto '' + (if _variants == [ ] then '' - install -m444 -Dt $out_ttf fonts/*/hinted/ttf/*-${weights}.ttf + for folder in $(ls -d fonts/*/); do + if [[ -d "$folder"unhinted/variable-ttf ]]; then + install -m444 -Dt $out_font "$folder"unhinted/variable-ttf/*.ttf + elif [[ -d "$folder"unhinted/otf ]]; then + install -m444 -Dt $out_font "$folder"unhinted/otf/*.otf + else + install -m444 -Dt $out_font "$folder"unhinted/ttf/*.ttf + fi + done '' else '' for variant in $_variants; do - install -m444 -Dt $out_ttf fonts/$variant/hinted/ttf/*-${weights}.ttf + if [[ -d fonts/"$variant"/unhinted/variable-ttf ]]; then + install -m444 -Dt $out_font fonts/"$variant"/unhinted/variable-ttf/*.ttf + elif [[ -d fonts/"$variant"/unhinted/otf ]]; then + install -m444 -Dt $out_font fonts/"$variant"/unhinted/otf/*.otf + else + install -m444 -Dt $out_font fonts/"$variant"/unhinted/ttf/*.ttf + fi done ''); @@ -112,12 +125,10 @@ rec { noto-fonts = mkNoto { pname = "noto-fonts"; - weights = "{Regular,Bold,Light,Italic,BoldItalic,LightItalic}"; }; noto-fonts-lgc-plus = mkNoto { pname = "noto-fonts-lgc-plus"; - weights = "{Regular,Bold,Light,Italic,BoldItalic,LightItalic}"; variants = [ "Noto Sans" "Noto Serif" @@ -135,11 +146,6 @@ rec { ''; }; - noto-fonts-extra = mkNoto { - pname = "noto-fonts-extra"; - weights = "{Black,Condensed,Extra,Medium,Semi,Thin}*"; - }; - noto-fonts-cjk-sans = mkNotoCJK { typeface = "Sans"; version = "2.004"; diff --git a/pkgs/top-level/aliases.nix b/pkgs/top-level/aliases.nix index 5004a976bd39..a001ff6c0f1b 100644 --- a/pkgs/top-level/aliases.nix +++ b/pkgs/top-level/aliases.nix @@ -1114,6 +1114,7 @@ mapAliases ({ nomad_1_1 = throw "nomad_1_1 has been removed because it's outdated. Use a a newer version instead"; # Added 2022-05-22 nordic-polar = throw "nordic-polar was removed on 2021-05-27, now integrated in nordic"; # Added 2021-05-27 noto-fonts-cjk = noto-fonts-cjk-sans; # Added 2021-12-16 + noto-fonts-extra = noto-fonts; # Added 2023-04-08 nottetris2 = throw "nottetris2 was removed because it is unmaintained by upstream and broken"; # Added 2022-01-15 now-cli = throw "now-cli has been replaced with nodePackages.vercel"; # Added 2021-08-05 ntdb = throw "ntdb has been removed: abandoned by upstream"; # Added 2022-04-21 diff --git a/pkgs/top-level/all-packages.nix b/pkgs/top-level/all-packages.nix index e9b205ef0918..ac4e1e2074a0 100644 --- a/pkgs/top-level/all-packages.nix +++ b/pkgs/top-level/all-packages.nix @@ -28168,8 +28168,7 @@ with pkgs; noto-fonts-cjk-sans noto-fonts-cjk-serif noto-fonts-emoji - noto-fonts-emoji-blob-bin - noto-fonts-extra; + noto-fonts-emoji-blob-bin; nuclear = callPackage ../applications/audio/nuclear { };