nixpkgs/pkgs/data/fonts/source-han-sans/default.nix

54 lines
1.5 KiB
Nix
Raw Normal View History

2017-08-10 21:43:49 +02:00
{stdenv, fetchzip}:
let
2017-08-10 21:43:49 +02:00
makePackage = {variant, language, region, sha256}: let
2015-09-15 16:45:19 +02:00
version = "1.004R";
revision = "5f5311e71cb628321cc0cffb51fb38d862b726aa";
2017-08-10 21:43:49 +02:00
in fetchzip {
name = "source-han-sans-${variant}-${version}";
2015-09-15 16:45:19 +02:00
2017-08-10 21:43:49 +02:00
url = "https://github.com/adobe-fonts/source-han-sans/raw/${revision}/SubsetOTF/SourceHanSans${region}.zip";
2017-08-10 21:43:49 +02:00
postFetch = ''
mkdir -p $out/share/fonts
unzip -j $downloadedFile \*.otf -d $out/share/fonts/opentype
2015-09-15 16:45:19 +02:00
'';
2017-08-10 21:43:49 +02:00
inherit sha256;
meta = {
description = "${language} subset of an open source Pan-CJK sans-serif typeface";
homepage = https://github.com/adobe-fonts/source-han-sans;
license = stdenv.lib.licenses.ofl;
platforms = stdenv.lib.platforms.unix;
maintainers = with stdenv.lib.maintainers; [ taku0 ];
};
};
in
{
japanese = makePackage {
2015-09-15 16:45:19 +02:00
variant = "japanese";
language = "Japanese";
region = "JP";
2017-08-10 21:43:49 +02:00
sha256 = "194zapswaqly8ycx3k66vznlapvpyhdigp3sabsl4hn87j9xsc5v";
};
korean = makePackage {
2015-09-15 16:45:19 +02:00
variant = "korean";
language = "Korean";
region = "KR";
2017-08-10 21:43:49 +02:00
sha256 = "0xij6mciiqgpwv1agqily2jji377x084k7fj4rpv6z0r5vvhqr08";
};
simplified-chinese = makePackage {
2015-09-15 16:45:19 +02:00
variant = "simplified-chinese";
language = "Simplified Chinese";
region = "CN";
2017-08-10 21:43:49 +02:00
sha256 = "038av18d45qr85bgx95j2fm8j64d72nsm9xzg0lpwr9xwni2sbx0";
};
traditional-chinese = makePackage {
2015-09-15 16:45:19 +02:00
variant = "traditional-chinese";
language = "Traditional Chinese";
region = "TW";
2017-08-10 21:43:49 +02:00
sha256 = "1mzcv5hksyxplyv5q3w5nr1xz73hdnvip5gicz35j0by4gc739lr";
};
}