-46
build.sh
-46
build.sh
···
1
-
#! /usr/bin/env bash
2
-
3
-
ff_filter() {
4
-
fontforge -c 'open(argv[1]).generate(argv[2])' "$1" "$2"
5
-
}
6
-
7
-
ttf_filter() {
8
-
# 1 - source file
9
-
# 2 - destination file
10
-
BNP=${BNP:="./BitsNPicas.jar"}
11
-
java -jar "$BNP" convertbitmap -f ttf -o "$2" "$1"
12
-
}
13
-
14
-
export_fonts() {
15
-
for i in src/*; do
16
-
local file_name
17
-
file_name=$(basename "${i%.*}")
18
-
ttf_filter "$i" "build/scientifica/ttf/$file_name.ttf"
19
-
ff_filter "$i" "build/scientifica/otb/$file_name.otb"
20
-
ff_filter "$i" "build/scientifica/bdf/$file_name.bdf"
21
-
done
22
-
}
23
-
24
-
export_plugins() {
25
-
cp -r ligature_plugins build/scientifica/ligature_plugins
26
-
}
27
-
28
-
main() {
29
-
rm -rf build
30
-
mkdir -p build/scientifica/{otb,ttf,bdf}
31
-
32
-
echo "[~] Exporting ligature plugins ..."
33
-
export_plugins
34
-
35
-
echo "[~] Exporting fonts ..."
36
-
export_fonts
37
-
38
-
echo "[~] Entering build directory ..."
39
-
cd build || echo "[!] Failed to enter build directory!"
40
-
tar c --file scientifica.tar scientifica
41
-
echo "[~] Leaving build directory ..."
42
-
43
-
echo "[!] Done!"
44
-
}
45
-
46
-
main
-24
default.nix
-24
default.nix
···
1
-
let
2
-
pkgs = import <nixpkgs> {};
3
-
in
4
-
with pkgs;
5
-
stdenv.mkDerivation rec {
6
-
name = "scientifica";
7
-
version = "v2.2";
8
-
src = ./src;
9
-
buildInputs = [ fontforge python3 xorg.mkfontdir ];
10
-
11
-
buildPhase = ''
12
-
for i in *; do
13
-
p=''${i%%.*}
14
-
fontforge -c 'open(argv[1]).generate(argv[2])' $i "$p".otb
15
-
done
16
-
'';
17
-
installPhase = ''
18
-
fontDir="$out/share/fonts/misc"
19
-
install -m 644 -D *.otb out/* -t "$fontDir"
20
-
mkfontdir "$fontDir"
21
-
'';
22
-
}
23
-
24
-
+44
flake.lock
+44
flake.lock
···
1
+
{
2
+
"nodes": {
3
+
"bitsnpicas-src": {
4
+
"flake": false,
5
+
"locked": {
6
+
"lastModified": 1632715939,
7
+
"narHash": "sha256-7QnQeKEAQry1aSXqmgwwTnuXVroUdpo+8t6aJhfO+1I=",
8
+
"owner": "kreativekorp",
9
+
"repo": "bitsnpicas",
10
+
"rev": "b47896afe02a381f5e76871a8c7da0ce50d76a99",
11
+
"type": "github"
12
+
},
13
+
"original": {
14
+
"owner": "kreativekorp",
15
+
"repo": "bitsnpicas",
16
+
"type": "github"
17
+
}
18
+
},
19
+
"nixpkgs": {
20
+
"locked": {
21
+
"lastModified": 1632918953,
22
+
"narHash": "sha256-XY3TKBfhP7wCu/SeqrwIkTWkyYHy5W1yRR8pxyzRY9Y=",
23
+
"owner": "NixOS",
24
+
"repo": "nixpkgs",
25
+
"rev": "ee90403e147b181300dffca5b0afa405e14f1945",
26
+
"type": "github"
27
+
},
28
+
"original": {
29
+
"owner": "NixOS",
30
+
"ref": "nixos-21.05",
31
+
"repo": "nixpkgs",
32
+
"type": "github"
33
+
}
34
+
},
35
+
"root": {
36
+
"inputs": {
37
+
"bitsnpicas-src": "bitsnpicas-src",
38
+
"nixpkgs": "nixpkgs"
39
+
}
40
+
}
41
+
},
42
+
"root": "root",
43
+
"version": 7
44
+
}
+88
flake.nix
+88
flake.nix
···
1
+
{
2
+
description = "Scientifica: tall and condensed bitmap font for geeks";
3
+
4
+
inputs = {
5
+
6
+
nixpkgs.url = "github:NixOS/nixpkgs/nixos-21.05";
7
+
8
+
bitsnpicas-src = {
9
+
url = "github:kreativekorp/bitsnpicas";
10
+
flake = false;
11
+
};
12
+
13
+
};
14
+
15
+
outputs =
16
+
{ self
17
+
, nixpkgs
18
+
, bitsnpicas-src
19
+
, ...
20
+
}:
21
+
let
22
+
supportedSystems = [ "x86_64-linux" "x86_64-darwin" ];
23
+
forAllSystems = nixpkgs.lib.genAttrs supportedSystems;
24
+
25
+
nixpkgsFor = forAllSystems (system:
26
+
import nixpkgs {
27
+
inherit system;
28
+
overlays = [ self.overlay ];
29
+
});
30
+
in
31
+
{
32
+
33
+
overlay = final: prev: rec {
34
+
35
+
bitsnpicas = with final; pkgs.writeScriptBin "bitsnpicas" ''
36
+
${jdk}/bin/java -jar ${bitsnpicas-src}/downloads/BitsNPicas.jar "$@"
37
+
'';
38
+
39
+
scientifica = with final; pkgs.stdenvNoCC.mkDerivation {
40
+
pname = "scientifica";
41
+
version = "v2.3";
42
+
src = ./src;
43
+
44
+
buildPhase = ''
45
+
runHook preBuild
46
+
47
+
ff_filter() {
48
+
${pkgs.fontforge}/bin/fontforge -c 'open(argv[1]).generate(argv[2])' "$@"
49
+
}
50
+
51
+
ttf_filter() {
52
+
${pkgs.bitsnpicas}/bin/bitsnpicas convertbitmap -f ttf -o "$2" "$1"
53
+
}
54
+
55
+
mkdir -p $out/{ttf,otb,bdf}
56
+
57
+
pushd $src
58
+
59
+
# generate font files
60
+
for i in *; do
61
+
local file_name
62
+
file_name="''${i%.*}"
63
+
ttf_filter "$i" "$out/ttf/$file_name.ttf"
64
+
ff_filter "$i" "$out/otb/$file_name.otb"
65
+
ff_filter "$i" "$out/bdf/$file_name.bdf"
66
+
done
67
+
68
+
popd
69
+
70
+
runHook postBuild
71
+
'';
72
+
73
+
installPhase = ''
74
+
true
75
+
'';
76
+
77
+
};
78
+
79
+
};
80
+
81
+
packages = forAllSystems (system: {
82
+
inherit (nixpkgsFor."${system}") scientifica bitsnpicas;
83
+
});
84
+
85
+
defaultPackage = forAllSystems (system: self.packages."${system}".scientifica);
86
+
87
+
};
88
+
}
+1
-1
ligature_plugins/README.md
+1
-1
ligature_plugins/README.md
···
15
15
cp ligature_plugins/rust.vim ~/.vim/after/syntax/
16
16
```
17
17
18
-
If you have `set conceallevel=0` if your `vimrc`, remove it.
18
+
If you have `set conceallevel=0` in your `vimrc`, remove it.
19
19
20
20
Big thanks to [romeovs](https://github.com/romeovs/) for
21
21
creating the haskell plugin and the idea of ligatures via
-6
shell.nix
-6
shell.nix
+5
-5
src/scientifica.sfd
+5
-5
src/scientifica.sfd
···
1835
1835
1836
1836
StartChar: gbreve
1837
1837
Encoding: 287 287 222
1838
-
Width: 1000
1838
+
Width: 454
1839
1839
VWidth: 0
1840
1840
Flags: W
1841
1841
LayerCount: 2
···
2339
2339
2340
2340
StartChar: Scedilla
2341
2341
Encoding: 350 350 285
2342
-
Width: 1000
2342
+
Width: 454
2343
2343
VWidth: 0
2344
2344
Flags: W
2345
2345
LayerCount: 2
···
9077
9077
BDFChar: 155 220 5 0 3 0 8
9078
9078
O8tB(OH>QcDu]k<
9079
9079
BDFChar: 156 221 5 0 3 0 8
9080
-
+@)$MODkbm?iU0,
9080
+
+@)$MODkbmDu]k<
9081
9081
BDFChar: 157 222 5 0 3 0 6
9082
9082
JDcNNOPkWh
9083
9083
BDFChar: 158 223 5 0 3 -1 5
···
9208
9208
+A`&WOH>QC&7>J<
9209
9209
BDFChar: 221 286 5 0 3 0 8
9210
9210
OC2IXJ:Okc?iU0,
9211
-
BDFChar: 222 287 11 0 3 -2 7
9211
+
BDFChar: 222 287 5 0 3 -2 7
9212
9212
OC/'-OH>QC&7>J<
9213
9213
BDFChar: 223 288 5 0 3 0 8
9214
9214
5QG2RJ:Okc?iU0,
···
9334
9334
+AcI-J7&qM?iU0,
9335
9335
BDFChar: 284 349 11 0 3 0 7
9336
9336
+A`&WJ7&rH
9337
-
BDFChar: 285 350 11 0 3 -2 6
9337
+
BDFChar: 285 350 5 0 3 -2 6
9338
9338
@$#nH&<L9B?iU0,
9339
9339
BDFChar: 286 351 5 0 3 -2 4
9340
9340
E.D=-i#lD-
+2
-2
src/scientificaBold.sfd
+2
-2
src/scientificaBold.sfd
···
51
51
DisplaySize: 11
52
52
AntiAlias: 1
53
53
FitToEm: 0
54
-
WinInfo: 0 58 15
54
+
WinInfo: 58 58 15
55
55
OnlyBitmaps: 1
56
56
BeginPrivate: 0
57
57
EndPrivate
···
8260
8260
BDFChar: 155 220 5 0 3 0 8
8261
8261
O8tB(OH>QcDu]k<
8262
8262
BDFChar: 156 221 5 0 3 0 8
8263
-
+@)$MODkbm?iU0,
8263
+
+@)$MODkbmDu]k<
8264
8264
BDFChar: 157 222 5 0 3 0 6
8265
8265
JDcNNOPkWh
8266
8266
BDFChar: 158 223 5 0 3 -1 5