From 211c9ba7f5cb9d742b7e22a86e7584c7ee816527 Mon Sep 17 00:00:00 2001 From: Pavan Rikhi Date: Sun, 7 Dec 2014 18:10:18 -0500 Subject: [PATCH] Add the Dina font --- pkgs/data/fonts/dina/default.nix | 63 ++++++++++++++++++++++++++++++++ pkgs/top-level/all-packages.nix | 2 + 2 files changed, 65 insertions(+) create mode 100644 pkgs/data/fonts/dina/default.nix diff --git a/pkgs/data/fonts/dina/default.nix b/pkgs/data/fonts/dina/default.nix new file mode 100644 index 000000000000..0420b5ea4d22 --- /dev/null +++ b/pkgs/data/fonts/dina/default.nix @@ -0,0 +1,63 @@ +{stdenv, fetchurl, unzip, bdftopcf, mkfontdir, mkfontscale}: + +stdenv.mkDerivation rec { + version = "2.92"; + name = "dina-font-${version}"; + + src = fetchurl { + url = "http://www.donationcoder.com/Software/Jibz/Dina/downloads/Dina.zip"; + sha256 = "1kq86lbxxgik82aywwhawmj80vsbz3hfhdyhicnlv9km7yjvnl8z"; + }; + + buildInputs = [ unzip bdftopcf mkfontdir mkfontscale ]; + + dontBuild = true; + patchPhase = "sed -i 's/microsoft-cp1252/ISO8859-1/' *.bdf"; + preInstall = '' + export _get_font_size() { + _pt=$\{1%.bdf} + _pt=$\{_pt#*-} + echo $_pt + } + ''; + installPhase = '' + + for i in Dina_i400-*.bdf; do + bdftopcf -t -o DinaItalic$(_get_font_size $i).pcf $i + done + for i in Dina_i700-*.bdf; do + bdftopcf -t -o DinaBoldItalic$(_get_font_size $i).pcf $i + done + for i in Dina_r400-*.bdf; do + bdftopcf -t -o DinaMedium$(_get_font_size $i).pcf $i + done + for i in Dina_r700-*.bdf; do + bdftopcf -t -o DinaBold$(_get_font_size $i).pcf $i + done + gzip *.pcf + + fontDir="$out/share/fonts/misc" + mkdir -p "$fontDir" + mv *.pcf.gz "$fontDir" + + cd "$fontDir" + mkfontdir + mkfontscale + ''; + + preferLocalBuild = true; + + meta = with stdenv.lib; { + description = "A monospace bitmap font aimed at programmers."; + longDescription = '' + Dina is a monospace bitmap font, primarily aimed at programmers. It is + relatively compact to allow a lot of code on screen, while (hopefully) + clear enough to remain readable even at high resolutions. + ''; + homepage = https://www.donationcoder.com/Software/Jibz/Dina/; + downloadPage = https://www.donationcoder.com/Software/Jibz/Dina/; + license = licenses.free; + maintainers = [ maintainers.prikhi ]; + platforms = platforms.linux; + }; +} diff --git a/pkgs/top-level/all-packages.nix b/pkgs/top-level/all-packages.nix index b75f4c0c1d93..31a47f7d2b1e 100644 --- a/pkgs/top-level/all-packages.nix +++ b/pkgs/top-level/all-packages.nix @@ -8833,6 +8833,8 @@ let inherit (perlPackages) FontTTF; }; + dina-font = callPackage ../data/fonts/dina { }; + docbook5 = callPackage ../data/sgml+xml/schemas/docbook-5.0 { }; docbook_sgml_dtd_31 = callPackage ../data/sgml+xml/schemas/sgml-dtd/docbook/3.1.nix { };