2021-03-27 18:36:02 +00:00
|
|
|
{ lib, stdenvNoCC, fetchurl, cabextract }:
|
2017-11-09 06:48:34 +00:00
|
|
|
|
2021-03-27 18:36:02 +00:00
|
|
|
stdenvNoCC.mkDerivation {
|
|
|
|
pname = "vista-fonts-chs";
|
|
|
|
version = "1";
|
2017-11-09 06:48:34 +00:00
|
|
|
|
2021-03-27 18:36:02 +00:00
|
|
|
src = fetchurl {
|
2022-01-06 17:08:29 +00:00
|
|
|
url = "https://web.archive.org/web/20161221192937if_/http://download.microsoft.com/download/d/6/e/d6e2ff26-5821-4f35-a18b-78c963b1535d/VistaFont_CHS.EXE";
|
2021-03-27 18:36:02 +00:00
|
|
|
# Alternative mirror:
|
|
|
|
# http://www.eeo.cn/download/font/VistaFont_CHS.EXE
|
|
|
|
sha256 = "1qwm30b8aq9piyqv07hv8b5bac9ms40rsdf8pwix5dyk8020i8xi";
|
|
|
|
};
|
2017-11-09 06:48:34 +00:00
|
|
|
|
2021-03-27 18:36:02 +00:00
|
|
|
nativeBuildInputs = [ cabextract ];
|
2017-11-09 06:48:34 +00:00
|
|
|
|
2021-03-27 18:36:02 +00:00
|
|
|
unpackPhase = ''
|
|
|
|
cabextract --lowercase --filter '*.TTF' $src
|
|
|
|
'';
|
2017-11-09 06:48:34 +00:00
|
|
|
|
2021-03-27 18:36:02 +00:00
|
|
|
installPhase = ''
|
2017-11-09 06:48:34 +00:00
|
|
|
mkdir -p $out/share/fonts/truetype
|
|
|
|
cp *.ttf $out/share/fonts/truetype
|
|
|
|
|
|
|
|
# Set up no-op font configs to override any aliases set up by
|
|
|
|
# other packages.
|
|
|
|
mkdir -p $out/etc/fonts/conf.d
|
|
|
|
substitute ${./no-op.conf} $out/etc/fonts/conf.d/30-msyahei.conf \
|
|
|
|
--subst-var-by fontname "Microsoft YaHei"
|
|
|
|
'';
|
|
|
|
|
|
|
|
meta = {
|
|
|
|
description = "TrueType fonts from Microsoft Windows Vista For Simplified Chinese (Microsoft YaHei)";
|
2020-04-01 02:11:51 +01:00
|
|
|
homepage = "https://www.microsoft.com/typography/fonts/family.aspx?FID=350";
|
2019-05-13 02:55:32 +01:00
|
|
|
license = lib.licenses.unfree;
|
|
|
|
maintainers = [ lib.maintainers.ChengCat ];
|
2017-11-09 06:48:34 +00:00
|
|
|
|
|
|
|
# Set a non-zero priority to allow easy overriding of the
|
|
|
|
# fontconfig configuration files.
|
|
|
|
priority = 5;
|
2019-05-13 02:55:32 +01:00
|
|
|
platforms = lib.platforms.all;
|
2017-11-09 06:48:34 +00:00
|
|
|
};
|
|
|
|
}
|