1{
2 lib,
3 stdenvNoCC,
4 fetchzip,
5}:
6
7let
8 version = "1.3.9";
9
10 mkPretendard =
11 {
12 pname,
13 typeface,
14 hash,
15 }:
16 stdenvNoCC.mkDerivation {
17 inherit pname version;
18
19 src = fetchzip {
20 url = "https://github.com/orioncactus/pretendard/releases/download/v${version}/${typeface}-${version}.zip";
21 stripRoot = false;
22 inherit hash;
23 };
24
25 installPhase = ''
26 runHook preInstall
27
28 install -Dm644 public/static/*.otf -t $out/share/fonts/opentype
29
30 runHook postInstall
31 '';
32
33 meta = with lib; {
34 homepage = "https://github.com/orioncactus/pretendard";
35 description = "Alternative font to system-ui for all platforms";
36 license = licenses.ofl;
37 platforms = platforms.all;
38 maintainers = with maintainers; [ sudosubin ];
39 };
40 };
41
42in
43{
44 pretendard = mkPretendard {
45 pname = "pretendard";
46 typeface = "Pretendard";
47 hash = "sha256-n7RQApffpL/8ojHcZbdxyanl9Tlc8HP8kxLFBdArUfY=";
48 };
49
50 pretendard-gov = mkPretendard {
51 pname = "pretendard-gov";
52 typeface = "PretendardGOV";
53 hash = "sha256-qoDUBOmrk6WPKQgnapThfKC01xWup+HN82hcoIjEe0M=";
54 };
55
56 pretendard-jp = mkPretendard {
57 pname = "pretendard-jp";
58 typeface = "PretendardJP";
59 hash = "sha256-1nTk1LPoRSfSDgDuGWkcs6RRIY4ZOqDBPMsxezMos6Q=";
60 };
61
62 pretendard-std = mkPretendard {
63 pname = "pretendard-std";
64 typeface = "PretendardStd";
65 hash = "sha256-gkYqqxSICmSIrBuPRzBaOlGGM/rJU1z7FiFvu9RhK5s=";
66 };
67}