~charles/dotfiles

dotfiles/install-fonts.sh -rwxr-xr-x 2.2 KiB
ca364fe3Charles Daniels add oshrc 7 days ago
                                                                                
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
#!/bin/sh

check_prog() {
	if [ ! -x "$(which "$1")" ] ; then
		echo "ERROR: could not find '$1' in PATH" 1>&2
		exit 1
	fi
}

set -u

check_prog curl

# source code pro font
mkdir -p ~/.fonts
curl -SsfLo ~/.fonts/SourceCodeVariable-Italic.ttf 'https://github.com/adobe-fonts/source-code-pro/releases/download/variable-fonts/SourceCodeVariable-Italic.ttf'
curl -SsfLo ~/.fonts/SourceCodeVariable-Roman.ttf 'https://github.com/adobe-fonts/source-code-pro/releases/download/variable-fonts/SourceCodeVariable-Roman.ttf'
curl -SsfLo ~/.fonts/Go-Smallcaps.ttf https://github.com/golang/image/raw/master/font/gofont/ttfs/Go-Smallcaps.ttf
curl -SsfLo ~/.fonts/Go-Bold-Italic.ttf https://github.com/golang/image/raw/master/font/gofont/ttfs/Go-Bold-Italic.ttf
curl -SsfLo ~/.fonts/Go-Bold.ttf https://github.com/golang/image/raw/master/font/gofont/ttfs/Go-Bold.ttf
curl -SsfLo ~/.fonts/Go-Italic.ttf https://github.com/golang/image/raw/master/font/gofont/ttfs/Go-Italic.ttf
curl -SsfLo ~/.fonts/Go-Medium-Italic.ttf https://github.com/golang/image/raw/master/font/gofont/ttfs/Go-Medium-Italic.ttf
curl -SsfLo ~/.fonts/Go-Medium.ttf https://github.com/golang/image/raw/master/font/gofont/ttfs/Go-Medium.ttf
curl -SsfLo ~/.fonts/Go-Mono-Bold-Italic.ttf https://github.com/golang/image/raw/master/font/gofont/ttfs/Go-Mono-Bold-Italic.ttf
curl -SsfLo ~/.fonts/Go-Mono-Bold.ttf https://github.com/golang/image/raw/master/font/gofont/ttfs/Go-Mono-Bold.ttf
curl -SsfLo ~/.fonts/Go-Mono-Italic.ttf https://github.com/golang/image/raw/master/font/gofont/ttfs/Go-Mono-Italic.ttf
curl -SsfLo ~/.fonts/Go-Mono.ttf https://github.com/golang/image/raw/master/font/gofont/ttfs/Go-Mono.ttf
curl -SsfLo ~/.fonts/Go-Regular.ttf https://github.com/golang/image/raw/master/font/gofont/ttfs/Go-Regular.ttf
curl -SsfLo ~/.fonts/Go-Smallcaps-Italic.ttf https://github.com/golang/image/raw/master/font/gofont/ttfs/Go-Smallcaps-Italic.ttf

TEMP="$(mktemp -d)"
cd "$TEMP"
git clone https://github.com/Tecate/bitmap-fonts.git
cd bitmap-fonts
cp -avr bitmap/*/*.bdf ~/.fonts
cp -avr bitmap/*/*/*.bdf ~/.fonts

cd ~
rm -rf "$TEMP"

cd ~/.fonts
for i in `ls ./*.bdf`; do fonttosfnt -v -b -c -g 2 -m 2 -o ${i%%.bdf}.otb $i; done
rm *.bdf

fc-cache -fv

exit 0