2019-10-29 09:38:59 +00:00
|
|
|
|
{ stdenv, fetchzip, fetchFromGitHub, optipng, cairo, python3Packages, pkgconfig, pngquant, which, imagemagick }:
|
2016-03-29 18:00:18 +00:00
|
|
|
|
|
2018-05-28 15:32:16 +00:00
|
|
|
|
let
|
|
|
|
|
mkNoto = { name, weights, sha256, }:
|
2018-12-04 08:49:31 +00:00
|
|
|
|
let
|
|
|
|
|
version = "2018-11-30";
|
|
|
|
|
ref = "85e78f831469323c85847e23f95026c894159135";
|
|
|
|
|
in
|
2018-05-28 15:32:16 +00:00
|
|
|
|
fetchzip {
|
|
|
|
|
name = "${name}-${version}";
|
|
|
|
|
inherit sha256;
|
2018-12-04 08:49:31 +00:00
|
|
|
|
url = "https://github.com/googlei18n/noto-fonts/archive/${ref}.zip";
|
2018-05-28 15:32:16 +00:00
|
|
|
|
postFetch = ''
|
|
|
|
|
unzip $downloadedFile
|
|
|
|
|
mkdir -p $out/share/fonts/noto
|
|
|
|
|
# Also copy unhinted & alpha fonts for better glyph coverage,
|
|
|
|
|
# if they don't have a hinted version
|
|
|
|
|
# (see https://groups.google.com/d/msg/noto-font/ZJSkZta4n5Y/tZBnLcPdbS0J)
|
|
|
|
|
for ttf in noto-fonts-*/{hinted,unhinted,alpha}/*-${weights}.ttf
|
|
|
|
|
do
|
|
|
|
|
cp -n "$ttf" -t "$out/share/fonts/noto"
|
|
|
|
|
done
|
|
|
|
|
'';
|
|
|
|
|
meta = with stdenv.lib; {
|
|
|
|
|
inherit version;
|
|
|
|
|
description = "Beautiful and free fonts for many languages";
|
|
|
|
|
homepage = https://www.google.com/get/noto/;
|
|
|
|
|
longDescription =
|
|
|
|
|
''
|
|
|
|
|
When text is rendered by a computer, sometimes characters are
|
|
|
|
|
displayed as “tofu”. They are little boxes to indicate your device
|
|
|
|
|
doesn’t have a font to display the text.
|
2015-09-19 22:22:20 +00:00
|
|
|
|
|
2018-05-28 15:32:16 +00:00
|
|
|
|
Google has been developing a font family called Noto, which aims to
|
|
|
|
|
support all languages with a harmonious look and feel. Noto is
|
|
|
|
|
Google’s answer to tofu. The name noto is to convey the idea that
|
|
|
|
|
Google’s goal is to see “no more tofu”. Noto has multiple styles and
|
|
|
|
|
weights, and freely available to all.
|
2015-09-19 22:22:20 +00:00
|
|
|
|
|
2018-05-28 15:32:16 +00:00
|
|
|
|
This package also includes the Arimo, Cousine, and Tinos fonts.
|
|
|
|
|
'';
|
|
|
|
|
license = licenses.asl20;
|
|
|
|
|
platforms = platforms.all;
|
|
|
|
|
maintainers = with maintainers; [ mathnerd314 ];
|
|
|
|
|
};
|
2015-09-19 22:22:20 +00:00
|
|
|
|
};
|
2018-05-28 15:32:16 +00:00
|
|
|
|
in
|
|
|
|
|
|
2019-08-13 21:52:01 +00:00
|
|
|
|
{
|
2018-05-28 15:32:16 +00:00
|
|
|
|
noto-fonts = mkNoto {
|
|
|
|
|
name = "noto-fonts";
|
|
|
|
|
weights = "{Regular,Bold,Light,Italic,BoldItalic,LightItalic}";
|
2018-12-04 08:49:31 +00:00
|
|
|
|
sha256 = "0kvq5ldip2ra2njlxg9fxj46nfqzq5l3n359d3kwfbsld7hixm2d";
|
2018-05-28 15:32:16 +00:00
|
|
|
|
};
|
|
|
|
|
noto-fonts-extra = mkNoto {
|
|
|
|
|
name = "noto-fonts-extra";
|
|
|
|
|
weights = "{Black,Condensed,Extra,Medium,Semi,Thin}*";
|
2018-12-04 08:49:31 +00:00
|
|
|
|
sha256 = "0l94aiy1b3qirg2mmbagbr0014vqk32za79pzck1acy2hgy716kq";
|
2015-09-19 22:22:20 +00:00
|
|
|
|
};
|
2017-08-11 13:29:41 +00:00
|
|
|
|
noto-fonts-cjk = let version = "1.004"; in fetchzip {
|
2015-09-19 22:22:20 +00:00
|
|
|
|
name = "noto-fonts-cjk-${version}";
|
|
|
|
|
|
2017-08-11 13:29:41 +00:00
|
|
|
|
# Same as https://noto-website.storage.googleapis.com/pkgs/NotoSansCJK.ttc.zip but versioned & with no extra SIL license file
|
|
|
|
|
url = "https://raw.githubusercontent.com/googlei18n/noto-cjk/40d9f5b179a59a06b98373c76bdc3e2119e4e6b2/NotoSansCJK.ttc.zip";
|
|
|
|
|
postFetch = ''
|
|
|
|
|
mkdir -p $out/share/fonts
|
|
|
|
|
unzip -j $downloadedFile \*.ttc -d $out/share/fonts/noto
|
2015-09-19 22:22:20 +00:00
|
|
|
|
'';
|
2017-08-11 13:29:41 +00:00
|
|
|
|
sha256 = "0ghw2azqq3nkcxsbvf53qjmrhcfsnry79rq7jsr0wwi2pn7d3dsq";
|
2015-09-19 22:22:20 +00:00
|
|
|
|
|
|
|
|
|
meta = with stdenv.lib; {
|
|
|
|
|
inherit version;
|
|
|
|
|
description = "Beautiful and free fonts for CJK languages";
|
|
|
|
|
homepage = https://www.google.com/get/noto/help/cjk/;
|
|
|
|
|
longDescription =
|
|
|
|
|
''
|
|
|
|
|
Noto Sans CJK is a sans serif typeface designed as an intermediate style
|
|
|
|
|
between the modern and traditional. It is intended to be a multi-purpose
|
|
|
|
|
digital font for user interface designs, digital content, reading on laptops,
|
|
|
|
|
mobile devices, and electronic books. Noto Sans CJK comprehensively covers
|
|
|
|
|
Simplified Chinese, Traditional Chinese, Japanese, and Korean in a unified font
|
|
|
|
|
family. It supports regional variants of ideographic characters for each of the
|
|
|
|
|
four languages. In addition, it supports Japanese kana, vertical forms, and
|
|
|
|
|
variant characters (itaiji); it supports Korean hangeul — both contemporary and
|
|
|
|
|
archaic.
|
|
|
|
|
'';
|
|
|
|
|
license = licenses.ofl;
|
|
|
|
|
platforms = platforms.all;
|
|
|
|
|
maintainers = with maintainers; [ mathnerd314 ];
|
|
|
|
|
};
|
|
|
|
|
};
|
2019-10-29 09:41:47 +00:00
|
|
|
|
noto-fonts-emoji = let
|
|
|
|
|
version = "unstable-2019-10-22";
|
|
|
|
|
in stdenv.mkDerivation {
|
2019-08-13 21:52:01 +00:00
|
|
|
|
pname = "noto-fonts-emoji";
|
|
|
|
|
inherit version;
|
2015-09-19 22:22:20 +00:00
|
|
|
|
|
|
|
|
|
src = fetchFromGitHub {
|
|
|
|
|
owner = "googlei18n";
|
|
|
|
|
repo = "noto-emoji";
|
2019-10-29 09:41:47 +00:00
|
|
|
|
rev = "018aa149d622a4fea11f01c61a7207079da301bc";
|
|
|
|
|
sha256 = "0qmnnjpp5lza6g5m3ki6hj46p891h9vl42k3acd0qw8i0jj5yn2c";
|
2015-09-19 22:22:20 +00:00
|
|
|
|
};
|
|
|
|
|
|
2016-03-29 18:05:32 +00:00
|
|
|
|
buildInputs = [ cairo ];
|
2016-03-29 18:00:18 +00:00
|
|
|
|
nativeBuildInputs = [ pngquant optipng which cairo pkgconfig imagemagick ]
|
2019-10-29 09:38:59 +00:00
|
|
|
|
++ (with python3Packages; [ python fonttools nototools ]);
|
2015-09-21 09:27:41 +00:00
|
|
|
|
|
2016-03-29 18:00:18 +00:00
|
|
|
|
postPatch = ''
|
|
|
|
|
sed -i 's,^PNGQUANT :=.*,PNGQUANT := ${pngquant}/bin/pngquant,' Makefile
|
|
|
|
|
patchShebangs flag_glyph_name.py
|
2015-09-21 09:27:41 +00:00
|
|
|
|
'';
|
2015-09-19 22:22:20 +00:00
|
|
|
|
|
2016-03-29 18:00:18 +00:00
|
|
|
|
enableParallelBuilding = true;
|
2015-09-19 22:22:20 +00:00
|
|
|
|
|
|
|
|
|
installPhase = ''
|
|
|
|
|
mkdir -p $out/share/fonts/noto
|
2016-03-29 18:00:18 +00:00
|
|
|
|
cp NotoColorEmoji.ttf fonts/NotoEmoji-Regular.ttf $out/share/fonts/noto
|
2015-09-19 22:22:20 +00:00
|
|
|
|
'';
|
|
|
|
|
|
|
|
|
|
meta = with stdenv.lib; {
|
|
|
|
|
inherit version;
|
|
|
|
|
description = "Color and Black-and-White emoji fonts";
|
|
|
|
|
homepage = https://github.com/googlei18n/noto-emoji;
|
2018-11-24 17:23:53 +00:00
|
|
|
|
license = with licenses; [ ofl asl20 ];
|
2015-09-19 22:22:20 +00:00
|
|
|
|
platforms = platforms.all;
|
|
|
|
|
maintainers = with maintainers; [ mathnerd314 ];
|
|
|
|
|
};
|
|
|
|
|
};
|
2015-09-21 09:27:41 +00:00
|
|
|
|
}
|