2017-08-10 21:43:49 +02:00
|
|
|
{stdenv, fetchzip}:
|
2015-01-15 14:05:46 +01:00
|
|
|
|
|
|
|
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";
|
2015-01-15 14:05:46 +01:00
|
|
|
|
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;
|
2015-01-15 14:05:46 +01:00
|
|
|
|
|
|
|
meta = {
|
2017-04-04 16:38:15 +02:00
|
|
|
description = "${language} subset of an open source Pan-CJK sans-serif typeface";
|
2015-01-15 14:05:46 +01:00
|
|
|
homepage = https://github.com/adobe-fonts/source-han-sans;
|
2017-04-05 15:52:16 +02:00
|
|
|
license = stdenv.lib.licenses.ofl;
|
2016-08-02 19:50:55 +02:00
|
|
|
platforms = stdenv.lib.platforms.unix;
|
2017-04-04 16:38:15 +02:00
|
|
|
maintainers = with stdenv.lib.maintainers; [ taku0 ];
|
2015-01-15 14:05:46 +01:00
|
|
|
};
|
|
|
|
};
|
|
|
|
in
|
|
|
|
{
|
|
|
|
japanese = makePackage {
|
2015-09-15 16:45:19 +02:00
|
|
|
variant = "japanese";
|
|
|
|
language = "Japanese";
|
2015-01-15 14:05:46 +01:00
|
|
|
region = "JP";
|
2017-08-10 21:43:49 +02:00
|
|
|
sha256 = "194zapswaqly8ycx3k66vznlapvpyhdigp3sabsl4hn87j9xsc5v";
|
2015-01-15 14:05:46 +01:00
|
|
|
};
|
|
|
|
korean = makePackage {
|
2015-09-15 16:45:19 +02:00
|
|
|
variant = "korean";
|
|
|
|
language = "Korean";
|
2015-01-15 14:05:46 +01:00
|
|
|
region = "KR";
|
2017-08-10 21:43:49 +02:00
|
|
|
sha256 = "0xij6mciiqgpwv1agqily2jji377x084k7fj4rpv6z0r5vvhqr08";
|
2015-01-15 14:05:46 +01:00
|
|
|
};
|
|
|
|
simplified-chinese = makePackage {
|
2015-09-15 16:45:19 +02:00
|
|
|
variant = "simplified-chinese";
|
|
|
|
language = "Simplified Chinese";
|
2015-01-15 14:05:46 +01:00
|
|
|
region = "CN";
|
2017-08-10 21:43:49 +02:00
|
|
|
sha256 = "038av18d45qr85bgx95j2fm8j64d72nsm9xzg0lpwr9xwni2sbx0";
|
2015-01-15 14:05:46 +01:00
|
|
|
};
|
|
|
|
traditional-chinese = makePackage {
|
2015-09-15 16:45:19 +02:00
|
|
|
variant = "traditional-chinese";
|
|
|
|
language = "Traditional Chinese";
|
2015-01-15 14:05:46 +01:00
|
|
|
region = "TW";
|
2017-08-10 21:43:49 +02:00
|
|
|
sha256 = "1mzcv5hksyxplyv5q3w5nr1xz73hdnvip5gicz35j0by4gc739lr";
|
2015-01-15 14:05:46 +01:00
|
|
|
};
|
|
|
|
}
|