forked from tzarskyz/dotfiles-1
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathvistafonts-installer
36 lines (27 loc) · 918 Bytes
/
vistafonts-installer
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
set -e
exists() { which "$1" &> /dev/null ; }
if ! [ -d ./fonts ] ; then
exec 2>&1
echo 'There is no fonts directory here.'
echo 'Please make one.'
exit 1
fi
# split up to keep the download command short
DL_HOST=download.microsoft.com
DL_PATH=download/f/5/a/f5a3df76-d856-4a61-a6bd-722f52a5be26
ARCHIVE=PowerPointViewer.exe
URL="http://$DL_HOST/$DL_PATH/$ARCHIVE"
if ! [ -e "$ARCHIVE" ] ; then
if exists curl ; then curl -O "$URL"
elif exists wget ; then wget "$URL"
elif exists fetch ; then fetch "$URL"
fi
fi
TMPDIR='work'
trap 'rm -rf "$TMPDIR"' EXIT INT QUIT TERM
cabextract -L -F ppviewer.cab -d "$TMPDIR" "$ARCHIVE"
cabextract -L -F '*.TT[FC]' -d ./fonts "$TMPDIR/ppviewer.cab"
( cd ./fonts && mv cambria.ttc cambria.ttf && chmod 600 \
calibri{,b,i,z}.ttf cambria{,b,i,z}.ttf candara{,b,i,z}.ttf \
consola{,b,i,z}.ttf constan{,b,i,z}.ttf corbel{,b,i,z}.ttf )
#fc-cache -fv ~/fonts