This repository has been archived by the owner on Sep 18, 2024. It is now read-only.
forked from izderadicka/pdfparser
-
Notifications
You must be signed in to change notification settings - Fork 8
/
Copy pathinstall_fonts.sh
executable file
·65 lines (54 loc) · 2.22 KB
/
install_fonts.sh
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
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
#!/bin/bash
#
# This file is part of pdfparser.
#
# pdfparse is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# pdfparser is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with pdfparser. If not, see <http://www.gnu.org/licenses/>.
#
# A part of this code was inspired by vistafonts-installer
# (http://plasmasturm.org/code/vistafonts-installer/). vistafonts-installer
# is a free software distributed under the terms of MIT License.
# For more information about the license see the attached original
# vistafonts-installer script.
set -e
apt-get install -y cabextract coreutils debconf fontconfig wget
MS_FONTS_ARCHIVE=IELPKTH.CAB
MS_FONTS_DIR=/usr/share/fonts/truetype/msttcorefonts/
VISTA_FONTS_ARCHIVE=PowerPointViewer.exe
VISTA_FONTS_DIR=/usr/share/fonts/truetype/vistafonts/
TMPDIR=`mktemp -d`
trap 'rm -rf $TMPDIR' EXIT INT QUIT TERM
cd "$TMPDIR"
echo ttf-mscorefonts-installer msttcorefonts/accepted-mscorefonts-eula select true | debconf-set-selections
apt-get install -y ttf-mscorefonts-installer
wget https://sourceforge.net/projects/corefonts/files/OldFiles/$MS_FONTS_ARCHIVE
if cabextract -L -F 'tahoma*ttf' -d $MS_FONTS_DIR $MS_FONTS_ARCHIVE
then
chmod 644 $MS_FONTS_DIR/tahoma*
fc-cache -fv $MS_FONTS_DIR
else
echo "ERROR: Failed to install Tahoma font!"
exit 1
fi
wget https://sourceforge.net/projects/mscorefonts2/files/cabs/$VISTA_FONTS_ARCHIVE
if cabextract -L -F ppviewer.cab $VISTA_FONTS_ARCHIVE
then
cabextract -L -F '*.TT[FC]' -d $VISTA_FONTS_DIR ppviewer.cab
( cd $VISTA_FONTS_DIR && mv cambria.ttc cambria.ttf && chmod 644 \
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 $VISTA_FONTS_DIR
else
echo "ERROR: Failed to install Vista fonts!"
exit 1
fi