summary refs log tree commit diff
path: root/pkgs/data/fonts/roboto-slab/default.nix
blob: f9f6ec342e9136c089a32aee778e083b0ca15cd0 (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
56
57
58
59
60
61
62
63
64
{ stdenv, fetchurl }:

let
  # last commit on the directory containing the fonts in the upstream repository
  commit = "883939708704a19a295e0652036369d22469e8dc";
in
stdenv.mkDerivation {
  pname = "roboto-slab";
  version = "2016-01-11";

  srcs = [
    (fetchurl {
      url = "https://raw.githubusercontent.com/google/fonts/${commit}/apache/robotoslab/RobotoSlab-Regular.ttf";
      sha256 = "04180b5zk2nzll1rrgx8f1i1za66pk6pbrp0iww2xypjqra5zahk";
    })
    (fetchurl {
      url = "https://raw.githubusercontent.com/google/fonts/${commit}/apache/robotoslab/RobotoSlab-Bold.ttf";
      sha256 = "0ayl2hf5j33vixxfa7051hzjjxnx8zhag3rr0mmmnxpsn7md44ms";
    })
    (fetchurl {
      url = "https://raw.githubusercontent.com/google/fonts/${commit}/apache/robotoslab/RobotoSlab-Light.ttf";
      sha256 = "09riqgj9ixqjdb3mkzbs799cgmnp3ja3d6izlqkhpkfm52sgafqm";
    })
    (fetchurl {
      url = "https://raw.githubusercontent.com/google/fonts/${commit}/apache/robotoslab/RobotoSlab-Thin.ttf";
      sha256 = "1hd0m7lxhr261a4s2nb572ari6v53w2yd8yjr9i534iqfl4jcbsf";
    })
  ];

  sourceRoot = "./";

  unpackCmd = ''
    ttfName=$(basename $(stripHash $curSrc))
    cp $curSrc ./$ttfName
  '';

  installPhase = ''
    mkdir -p $out/share/fonts/truetype
    cp -a *.ttf $out/share/fonts/truetype/
  '';

  outputHashAlgo = "sha256";
  outputHashMode = "recursive";
  outputHash = "0imhvisjzi0rvn32hn04kngca4szx0j39h4c4zs7ryb4wdca76q9";

  meta = {
    homepage = https://www.google.com/fonts/specimen/Roboto+Slab;
    description = "Google Roboto Slab fonts";
    longDescription = ''
      Roboto has a dual nature. It has a mechanical skeleton and the forms
      are largely geometric. At the same time, the font features friendly
      and open curves. While some grotesks distort their letterforms to
      force a rigid rhythm, Roboto doesn't compromise, allowing letters to
      be settled into their natural width. This makes for a more natural
      reading rhythm more commonly found in humanist and serif types.

      This is the Roboto Slab family, which can be used alongside the normal
      Roboto family and the Roboto Condensed family.
    '';
    license = stdenv.lib.licenses.asl20;
    maintainers = [ stdenv.lib.maintainers.romildo ];
    platforms = stdenv.lib.platforms.all;
  };
}