blob: 28ec08f63b6d43e45a6ba8154132c715fef0d892 (
plain) (
blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
|
{ stdenvNoCC
, lib
, fetchzip
, fetchurl
}:
let
makePackage = { family, description, rev, sha256 }: let
Family =
lib.toUpper (lib.substring 0 1 family) +
lib.substring 1 (lib.stringLength family) family;
ttc = fetchurl {
url = "https://github.com/adobe-fonts/source-han-${family}/releases/download/${rev}/SourceHan${Family}.ttc";
inherit sha256;
};
in stdenvNoCC.mkDerivation {
pname = "source-han-${family}";
version = lib.removeSuffix "R" rev;
buildCommand = ''
mkdir -p $out/share/fonts/opentype/source-han-${family}
ln -s ${ttc} $out/share/fonts/opentype/source-han-${family}/SourceHan${Family}.ttc
'';
meta = {
description = "An open source Pan-CJK ${description} typeface";
homepage = "https://github.com/adobe-fonts/source-han-${family}";
license = lib.licenses.ofl;
maintainers = with lib.maintainers; [ taku0 emily ];
};
};
in
{
sans = makePackage {
family = "sans";
description = "sans-serif";
rev = "2.001R";
sha256 = "101p8q0sagf1sd1yzwdrmmxvkqq7j0b8hi0ywsfck9w56r4zx54y";
};
serif = makePackage {
family = "serif";
description = "serif";
rev = "1.001R";
sha256 = "1d968h30qvvwy3s77m9y3f1glq8zlr6bnfw00yinqa18l97n7k45";
};
mono = makePackage {
family = "mono";
description = "monospaced";
rev = "1.002";
sha256 = "1haqffkcgz0cc24y8rc9bg36v8x9hdl8fdl3xc8qz14hvr42868c";
};
}
|