1 { lib, stdenv, fetchzip, fontforge
9 outputs = [ "out" "bdf" ];
12 url = "https://www.dcmembers.com/jibsen/download/61/?wpdmdl=61";
13 hash = "sha256-JK+vnOyhAbwT825S+WKbQuWgRrfZZHfyhaMQ/6ljO8s=";
19 [ fontforge bdftopcf xorg.mkfontscale xorg.fonttosfnt ];
26 test "''${name:5:1}" = i && _it=Italic || _it=
28 400) _weight=Medium ;;
33 echo "Dina$_weight$_it$_pt"
36 # Re-encode the provided BDF files from CP1252 to Unicode as fonttosfnt does
37 # not support the former.
38 # We could generate the PCF and OTB files with fontforge directly, but that
39 # results in incorrect spacing in various places.
40 for f in BDF/*.bdf; do
41 basename=''${f##*/} basename=''${basename%.*}
42 fontforge -lang=ff -c "Open(\"$f\"); Reencode(\"win\", 1); Reencode(\"unicode\"); Generate(\"$basename.bdf\")"
43 mv "$basename"-*.bdf "$basename".bdf # remove the superfluous added size suffix
48 bdftopcf -t -o "$name.pcf" "$f"
49 fonttosfnt -v -o "$name.otb" "$f"
59 install -D -m 644 -t "$out/share/fonts/misc" *.pcf.gz *.otb
60 install -D -m 644 -t "$bdf/share/fonts/misc" *.bdf
61 mkfontdir "$out/share/fonts/misc"
62 mkfontdir "$bdf/share/fonts/misc"
68 description = "Monospace bitmap font aimed at programmers";
70 Dina is a monospace bitmap font, primarily aimed at programmers. It is
71 relatively compact to allow a lot of code on screen, while (hopefully)
72 clear enough to remain readable even at high resolutions.
74 homepage = "https://www.dcmembers.com/jibsen/download/61/";
75 license = licenses.free;
76 maintainers = with maintainers; [ prikhi ncfavier ];