Debian Codegraph @

texmf-dist/doc/latex/tengwarscript/install-tengwar-scripts.sh

raw
1 #!/usr/bin/env bash
2
3 # Check the tengwarscript package is installed.
4 kpsewhich tengwarscript.sty
5 ERROR_CODE=$?
6 if [ $ERROR_CODE -ne 0 ]; then
7 echo "Error: tengwarscript is not installed."
8 exit $ERROR_CODE
9 fi
10
11 # Terminate as soon as any command fails
12 set -e
13
14 # Enable the font maps in the tengwarscript package.
15 updmap --enable Map=tengwarscript.map
16
17 # Choose the directory to put the fonts in.
18 # This could also be just ~/texmf/fonts/truetype.
19 # The additional directory is a little neater, though,
20 # and matches the documentation.
21 FONT_DIR=~/texmf/fonts/truetype/tengwarscript
22 mkdir --parents $FONT_DIR
23 cd $FONT_DIR
24
25 # Note: the following way of entering and exiting directories avoids having to prefix every file with $FONT_DIR,
26 # but also makes it susceptible to forgetting the current directory and end up putting things in the wrong place.
27 # I've decided that it's easier to explicitly enter and exit directories than to put $FONT_DIR in front of everything,
28 # and then potentially forget that when editing later.
29 mkdir --parents parmaite
30 wget --no-verbose --continue 'http://at.mansbjorkman.net/Downloads/Parmaite2.zip'
31 unzip -u Parmaite2.zip -d $FONT_DIR/parmaite
32 cd parmaite
33 mv --verbose Parmaite.TTF Parmaite.ttf
34 mv --verbose Parmaite_alt.TTF Parmaite_alt.ttf
35 cd $FONT_DIR
36
37 mkdir --parents elfica
38 wget --no-verbose --continue 'http://www.oocities.org/enrombell/files/Pack_en.zip'
39 unzip -u Pack_en.zip -d $FONT_DIR/elfica
40 cd elfica
41 mv --verbose Elfica200841se07.ttf Elfica32.ttf
42 cd $FONT_DIR
43
44 mkdir --parents gothika
45 wget --no-verbose --continue 'http://www.oocities.org/enrombell/files/Gothika_en.zip'
46 unzip -u Gothika_en.zip -d $FONT_DIR/gothika
47 cd gothika
48 mv --verbose Gothika2008-se001.ttf TengwarGothika050.ttf
49 cd $FONT_DIR
50
51 mkdir --parents formal
52 wget --no-verbose --continue 'http://tengwarformal.limes.com.pl/fonts/TengwarFormal-12c-ttf-pc.zip'
53 unzip -u TengwarFormal-12c-ttf-pc.zip -d $FONT_DIR/formal
54 cd formal/TengwarFormal-12c-ttf-pc/fonts
55 mv --verbose TengwarFormal12b.ttf TengwarFormal12.ttf
56 mv --verbose TengwarFormalA12b.ttf TengwarFormalA12.ttf
57 cd $FONT_DIR
58
59 mkdir --parents annatar
60 wget --no-verbose --continue -O annatar.zip 'http://web.comhem.se/alatius/fonts/tngan120.zip'
61 unzip -u annatar.zip -d $FONT_DIR/annatar
62
63 mkdir --parents quenya
64 wget --no-verbose --continue -O quenya.zip 'http://img.dafont.com/dl/?f=tengwar_quenya'
65 unzip -u quenya.zip -d $FONT_DIR/quenya
66 cd quenya
67 mv --verbose QUENYA.TTF TengwarQuenya.ttf
68 mv --verbose QUENYAA.TTF TengwarQuenyaAlt.ttf
69 mv --verbose QUENCAP1.TTF TengwarQuenyaCapitals1.ttf
70 mv --verbose QUENCAP2.TTF TengwarQuenyaCapitals2.ttf
71 cd $FONT_DIR
72
73 mkdir --parents sindarin
74 wget --no-verbose --continue -O sindarin.zip 'http://img.dafont.com/dl/?f=tengwar_sindarin'
75 unzip -u sindarin.zip -d $FONT_DIR/sindarin
76 cd sindarin
77 mv --verbose SINDAR.TTF TengwarSindarin.ttf
78 mv --verbose SINDARA.TTF TengwarSindarinAlt.ttf
79 mv --verbose SINDCAP1.TTF TengwarSindarinCapitals1.ttf
80 mv --verbose SINDCAP2.TTF TengwarSindarinCapitals2.ttf
81 cd $FONT_DIR
82
83 mkdir --parents noldor
84 wget --no-verbose --continue -O noldor.zip 'http://img.dafont.com/dl/?f=tengwar_noldor'
85 unzip -u noldor.zip -d $FONT_DIR/noldor
86 cd noldor
87 mv --verbose NOLDOR.TTF TengwarNoldor.ttf
88 mv --verbose NOLDORA.TTF TengwarNoldorAlt.ttf
89 mv --verbose NOLDCAP1.TTF TengwarNoldorCapitals1.ttf
90 mv --verbose NOLDCAP2.TTF TengwarNoldorCapitals2.ttf
91 cd $FONT_DIR
92
93 mkdir --parents teleri
94 wget --no-verbose --continue -O teleri.zip 'http://img.dafont.com/dl/?f=tengwar_teleri'
95 unzip -u teleri.zip -d $FONT_DIR/teleri
96 cd teleri
97 mv --verbose 'Tengwar Telerin.ttf' TengwarTelerin.ttf
98 cd $FONT_DIR
99
100 mkdir --parents ~/texmf/fonts/type1/tengwarscript/
101 cd ~/texmf/fonts/type1/tengwarscript/
102 mkdir --parents unicodeparmaite
103 wget --no-verbose --continue 'http://www.uv.es/~conrad/UnicodeTengwarParmaite.tar.gz'
104 tar --ungzip --extract --overwrite --keep-newer-files --file UnicodeTengwarParmaite.tar.gz --directory unicodeparmaite
105 cd unicodeparmaite
106 mv --verbose parmaite.pfb UnicodeParmaite.pfb
107 cd ~/texmf/fonts/type1/tengwarscript/
108
109 # DONE: update names to match /usr/share/texlive/texmf-dist/fonts/map/dvips/tengwarscript/tengwarscript.map
110 # DONE: install unicodeparmaite as well
111 # DONE: make install safer by removing `cd -` commands.