2017-08-10 20:43:49 +01:00
|
|
|
{stdenv, fetchzip}:
|
2017-04-04 15:38:15 +01:00
|
|
|
|
|
|
|
let
|
2017-08-10 20:43:49 +01:00
|
|
|
makePackage = {variant, language, region, sha256}: let
|
2017-04-04 15:38:15 +01:00
|
|
|
version = "1.000R";
|
|
|
|
revision = "f6cf97d92b22e7bd77e355a61fe549ae44b6de76";
|
2017-08-10 20:43:49 +01:00
|
|
|
in fetchzip {
|
|
|
|
name = "source-han-serif-${variant}-${version}";
|
2017-04-04 15:38:15 +01:00
|
|
|
|
2017-08-10 20:43:49 +01:00
|
|
|
url = "https://github.com/adobe-fonts/source-han-serif/raw/${revision}/SubsetOTF/SourceHanSerif${region}.zip";
|
2017-04-04 15:38:15 +01:00
|
|
|
|
2017-08-10 20:43:49 +01:00
|
|
|
postFetch = ''
|
2017-04-04 15:38:15 +01:00
|
|
|
mkdir -p $out/share/fonts/opentype
|
2017-08-10 20:43:49 +01:00
|
|
|
unzip -j $downloadedFile \*.otf -d $out/share/fonts/opentype
|
2017-04-04 15:38:15 +01:00
|
|
|
'';
|
|
|
|
|
2017-08-10 20:43:49 +01:00
|
|
|
inherit sha256;
|
|
|
|
|
2017-04-04 15:38:15 +01:00
|
|
|
meta = {
|
|
|
|
description = "${language} subset of an open source Pan-CJK 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 {
|
|
|
|
variant = "japanese";
|
|
|
|
language = "Japanese";
|
|
|
|
region = "JP";
|
2017-08-10 20:43:49 +01:00
|
|
|
sha256 = "0cklcy6y3r7pg8z43fzd8zl5g46bkqa1iy0li49rm0fgdaw7kin2";
|
2017-04-04 15:38:15 +01:00
|
|
|
};
|
|
|
|
korean = makePackage {
|
|
|
|
variant = "korean";
|
|
|
|
language = "Korean";
|
|
|
|
region = "KR";
|
2017-08-10 20:43:49 +01:00
|
|
|
sha256 = "0lxrr978djsych8fmbl57n1c9c7ihl61w0b9q4plw27vd6p41fza";
|
2017-04-04 15:38:15 +01:00
|
|
|
};
|
|
|
|
simplified-chinese = makePackage {
|
|
|
|
variant = "simplified-chinese";
|
|
|
|
language = "Simplified Chinese";
|
|
|
|
region = "CN";
|
2017-08-10 20:43:49 +01:00
|
|
|
sha256 = "0k3x4kncjnbipf4i3lkk6b33zpf1ckp5648z51v48q47l3zqpm6p";
|
2017-04-04 15:38:15 +01:00
|
|
|
};
|
|
|
|
traditional-chinese = makePackage {
|
|
|
|
variant = "traditional-chinese";
|
|
|
|
language = "Traditional Chinese";
|
|
|
|
region = "TW";
|
2017-08-10 20:43:49 +01:00
|
|
|
sha256 = "00bi66nlkrargmmf4av24qfd716py7a9smcvr4xnll7fffldxv06";
|
2017-04-04 15:38:15 +01:00
|
|
|
};
|
|
|
|
}
|