mirror of
https://github.com/NixOS/nixpkgs.git
synced 2025-01-22 14:45:27 +00:00
dina: generate otb files with fontforge
Note: the encoding of the Dina BDF fonts is not unicode and apparently fonttosfnt can't handle them.
This commit is contained in:
parent
7f7c94497a
commit
36ca91e253
|
@ -1,5 +1,5 @@
|
|||
{ stdenv, fetchurl, unzip
|
||||
, bdftopcf, mkfontscale
|
||||
, bdftopcf, mkfontscale, fontforge
|
||||
}:
|
||||
|
||||
stdenv.mkDerivation {
|
||||
|
@ -12,7 +12,7 @@ stdenv.mkDerivation {
|
|||
};
|
||||
|
||||
nativeBuildInputs =
|
||||
[ unzip bdftopcf mkfontscale ];
|
||||
[ unzip bdftopcf mkfontscale fontforge ];
|
||||
|
||||
patchPhase = "sed -i 's/microsoft-cp1252/ISO8859-1/' *.bdf";
|
||||
|
||||
|
@ -33,15 +33,23 @@ stdenv.mkDerivation {
|
|||
bdftopcf -t -o $(newName "$i").pcf "$i"
|
||||
done
|
||||
gzip -n -9 *.pcf
|
||||
|
||||
# convert bdf fonts to otb
|
||||
for i in *.bdf; do
|
||||
fontforge -lang=ff -c "Open(\"$i\"); Generate(\"$(newName $i).otb\")"
|
||||
done
|
||||
'';
|
||||
|
||||
installPhase = ''
|
||||
install -D -m 644 -t "$out/share/fonts/misc" *.pcf.gz
|
||||
install -D -m 644 -t "$bdf/share/fonts/misc" *.bdf
|
||||
install -D -m 644 -t "$otb/share/fonts/misc" *.otb
|
||||
mkfontdir "$out/share/fonts/misc"
|
||||
mkfontdir "$bdf/share/fonts/misc"
|
||||
mkfontdir "$otb/share/fonts/misc"
|
||||
'';
|
||||
|
||||
outputs = [ "out" "bdf" ];
|
||||
outputs = [ "out" "bdf" "otb" ];
|
||||
|
||||
meta = with stdenv.lib; {
|
||||
description = "A monospace bitmap font aimed at programmers";
|
||||
|
|
Loading…
Reference in a new issue