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