noto-fonts: switch to variable fonts and remove noto-font-extra

This commit is contained in:
jopejoe1 2023-04-08 22:08:04 +02:00
parent fbe6137a0d
commit c347bd62a1
3 changed files with 22 additions and 16 deletions

View File

@ -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";

View File

@ -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

View File

@ -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 { };