9 When text is rendered by a computer, sometimes characters are
10 displayed as “tofu”. They are little boxes to indicate your device
11 doesn’t have a font to display the text.
12 Google has been developing a font family called Noto, which aims to
13 support all languages with a harmonious look and feel. Noto is
14 Google’s answer to tofu. The name noto is to convey the idea that
15 Google’s goal is to see “no more tofu”. Noto has multiple styles and
16 weights, and freely available to all.
20 stdenvNoCC.mkDerivation rec {
21 pname = "noto-fonts${suffix}";
24 src = fetchFromGitHub {
26 repo = "notofonts.github.io";
27 rev = "noto-monthly-release-${version}";
28 hash = "sha256-bopBRpIGXtRyAjBuMhJCjwFUlK8WDurxIFbZbRzEE40=";
31 _variants = map (variant: builtins.replaceStrings [ " " ] [ "" ] variant) variants;
34 # We check availability in order of variable -> otf -> ttf
35 # unhinted -- the hinted versions use autohint
36 # maintaining maximum coverage.
38 # We have a mix of otf and ttf fonts
39 local out_font=$out/share/fonts/noto
40 '' + (if _variants == [ ] then ''
41 for folder in $(ls -d fonts/*/); do
42 if [[ -d "$folder"unhinted/variable-ttf ]]; then
43 install -m444 -Dt $out_font "$folder"unhinted/variable-ttf/*.ttf
44 elif [[ -d "$folder"unhinted/otf ]]; then
45 install -m444 -Dt $out_font "$folder"unhinted/otf/*.otf
47 install -m444 -Dt $out_font "$folder"unhinted/ttf/*.ttf
51 for variant in $_variants; do
52 if [[ -d fonts/"$variant"/unhinted/variable-ttf ]]; then
53 install -m444 -Dt $out_font fonts/"$variant"/unhinted/variable-ttf/*.ttf
54 elif [[ -d fonts/"$variant"/unhinted/otf ]]; then
55 install -m444 -Dt $out_font fonts/"$variant"/unhinted/otf/*.otf
57 install -m444 -Dt $out_font fonts/"$variant"/unhinted/ttf/*.ttf
62 passthru.updateScript = gitUpdater {
63 rev-prefix = "noto-monthly-release-";
66 passthru.tests = { inherit (nixosTests) noto-fonts; };
69 description = "Beautiful and free fonts for many languages";
70 homepage = "https://www.google.com/get/noto/";
71 inherit longDescription;
72 license = lib.licenses.ofl;
73 platforms = lib.platforms.all;
74 maintainers = with lib.maintainers; [ mathnerd314 emily jopejoe1 ];