From 3bad67b25652306f49b77deb3f176eff73876632 Mon Sep 17 00:00:00 2001 From: Akshay Date: Fri, 1 Oct 2021 21:45:56 +0530 Subject: close #55, #51 --- flake.nix | 90 +++++++++++++++++++++++++++++++++++++++++++++++ src/scientifica.sfd | 10 +++--- src/scientificaBold.sfd | 4 +-- src/scientificaItalic.sfd | 2 +- 4 files changed, 98 insertions(+), 8 deletions(-) create mode 100644 flake.nix diff --git a/flake.nix b/flake.nix new file mode 100644 index 0000000..cb2c04c --- /dev/null +++ b/flake.nix @@ -0,0 +1,90 @@ +{ + description = "Scientifica: tall and condensed bitmap font for geeks"; + + inputs = { + + nixpkgs.url = "github:NixOS/nixpkgs/nixos-21.05"; + + bitsnpicas-src = { + url = "github:kreativekorp/bitsnpicas"; + flake = false; + }; + + }; + + outputs = + { self + , nixpkgs + , bitsnpicas-src + , ... + }: + let + supportedSystems = [ "x86_64-linux" "x86_64-darwin" ]; + forAllSystems = nixpkgs.lib.genAttrs supportedSystems; + + nixpkgsFor = forAllSystems (system: + import nixpkgs { + inherit system; + overlays = [ self.overlay ]; + }); + in + { + + overlay = final: prev: rec { + + bitsnpicas = with final; pkgs.writeScriptBin "bitsnpicas" '' + ${jdk}/bin/java -jar ${bitsnpicas-src}/downloads/BitsNPicas.jar + ''; + + scientifica = with final; pkgs.stdenvNoCC.mkDerivation { + pname = "scientifica"; + version = "v2.3"; + src = ./.; + + buildPhase = '' + runHook preBuild + + fontforge=${pkgs.fontforge}/bin/fontforge + bitsnpicas=${self.packages.bitsnpicas}/bin/bitsnpicas + + ff_filter() { + fontforge -c 'open(argv[1]).generate(argv[2])' "$@" + } + + ttf_filter() { + bitsnpicas convertbitmap -f ttf -o "$2" "$1" + } + + mkdir -p $out/{ttf,otb,bdf} + + pushd $src + + # generate font files + for i in *; do + local file_name + file_name="''${i%.*}" + ttf_filter "$i" "$out/ttf/$file_name.ttf" + ff_filter "$i" "$out/otb/$file_name.otb" + ff_filter "$i" "$out/bdf/$file_name.bdf" + done + + # copy ligature plugins + cp -r $src/ligature_plugins $out/ligature_plugins + + popd + + runHook postBuild + ''; + + }; + + }; + + packages = forAllSystems (system: { + inherit (nixpkgsFor."${system}") scientifica bitsnpicas; + }); + + defaultPackage = forAllSystems (system: self.packages."${system}".scientifica); + + }; +} diff --git a/src/scientifica.sfd b/src/scientifica.sfd index d398caf..f503b2e 100644 --- a/src/scientifica.sfd +++ b/src/scientifica.sfd @@ -1835,7 +1835,7 @@ EndChar StartChar: gbreve Encoding: 287 287 222 -Width: 1000 +Width: 454 VWidth: 0 Flags: W LayerCount: 2 @@ -2339,7 +2339,7 @@ EndChar StartChar: Scedilla Encoding: 350 350 285 -Width: 1000 +Width: 454 VWidth: 0 Flags: W LayerCount: 2 @@ -9077,7 +9077,7 @@ BDFChar: 154 219 5 0 3 0 8 BDFChar: 155 220 5 0 3 0 8 O8tB(OH>QcDu]k< BDFChar: 156 221 5 0 3 0 8 -+@)$MODkbm?iU0, ++@)$MODkbmDu]k< BDFChar: 157 222 5 0 3 0 6 JDcNNOPkWh BDFChar: 158 223 5 0 3 -1 5 @@ -9208,7 +9208,7 @@ BDFChar: 220 285 11 0 3 -2 7 +A`&WOH>QC&7>J< BDFChar: 221 286 5 0 3 0 8 OC2IXJ:Okc?iU0, -BDFChar: 222 287 11 0 3 -2 7 +BDFChar: 222 287 5 0 3 -2 7 OC/'-OH>QC&7>J< BDFChar: 223 288 5 0 3 0 8 5QG2RJ:Okc?iU0, @@ -9334,7 +9334,7 @@ BDFChar: 283 348 11 0 3 0 8 +AcI-J7&qM?iU0, BDFChar: 284 349 11 0 3 0 7 +A`&WJ7&rH -BDFChar: 285 350 11 0 3 -2 6 +BDFChar: 285 350 5 0 3 -2 6 @$#nH&QcDu]k< BDFChar: 156 221 5 0 3 0 8 -+@)$MODkbm?iU0, ++@)$MODkbmDu]k< BDFChar: 157 222 5 0 3 0 6 JDcNNOPkWh BDFChar: 158 223 5 0 3 -1 5 diff --git a/src/scientificaItalic.sfd b/src/scientificaItalic.sfd index b38c330..81ccd2d 100644 --- a/src/scientificaItalic.sfd +++ b/src/scientificaItalic.sfd @@ -7942,7 +7942,7 @@ BDFChar: 157 219 5 0 3 0 8 BDFChar: 158 220 5 0 3 0 8 O8tB(OH>QcDu]k< BDFChar: 159 221 5 0 3 0 8 -+@)$MODkbm?iU0, ++@)$MODkbmDu]k< BDFChar: 160 222 5 0 3 0 6 JDcNNOPkWh BDFChar: 161 223 5 0 3 -1 5 -- cgit v1.2.3