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

54 lines
1.5 KiB
Nix
Raw Normal View History

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