Debian Codegraph @

texk/texlive/linked_scripts/installfont/installfont-tl

raw symbols SCIP
1 #!/bin/bashscip-shell filesystem . . `/bin/bash`.
2 #
3 # installfont-tl [options]
4 #
5 # installs a LaTeX font family (Postscript Type1, Truetype, Opentype)
6 # (font series from light to ultra bold + (faked) small caps + faked
7 # slanted, but no expert fonts) for using them with LaTeX (TeXLive)
8 # The script tries to rename the fonts automatically (optional).
9 # Otherwise the *.afm and *.pfb files must be named in Karl Berry scheme
10 # (e.g. 5bbr8a.pfb)
11 # (tested with TeXLive2013/Cygwin) v1.7 (15.07.2013)
12 # (C) Josef Kleber 2009-2010,2013 License: LPPL
13 #
14 VERSION="v1.7 (2013/07/15)"
15 #
16 FONTFAMILY="5bb"
17 FONTNAME="Softmaker Barbedor"
18 FONTCOMMAND="FFBarbedor"
19 FONTSCALEPREFIX="Sbb"
20 FONTTYPE="pst1"
21 PACKAGENAME="barbedor"
22 PACKAGEDATE="2010/03/05"
23 PACKAGEVERSION="v1.0"
24 MAPFILENAME=""
25 OFN="false"
26 WINLOCALTEXMF="`kpsewhich --expand-var='$TEXMFLOCAL' | sedscip-shell system . . sed. s/\r//`"
27 USEDOS=`unamescip-shell system . . uname. | cutscip-shell system . . cut. -c1-6`
28 if [scip-shell system . . `[`. "$USEDOS" = "CYGWIN" ]
29 then
30 WINLOCALTEXMFII="`cygpath -u $WINLOCALTEXMF`"
31 LOCALTEXMF="$WINLOCALTEXMFII"
32 else
33 LOCALTEXMF="$WINLOCALTEXMF"
34 fi
35 FONTSUBDIR="MyFonts/Barbedor"
36 # Font encoding default: 8a (AdobeStandardEncoding)
37 FONTENCODING="8a"
38 # Font cut default: r (regular) don't change!
39 FONTCUT="r"
40 #
41 OTFFONTFEATURES="-fkern -fliga"
42 UNINSTALL="false"
43 INSTALLAS="rmdefault"
44 SMFFSTY="%"
45 LOG="false"
46 #
47 function printHelpscip-shell shell texlive-bin 2026.20260303.78225+ds-4 printHelp().()
48 {
49 echoscip-shell system . . echo. -e \
50 " `basename $0` [options]\n"\
51 " installs a font family for using it with LaTeX\n\n"\
52 " Options:\n\n"\
53 " -f, --fontfamily Name of the LaTeX font family, e.g. ptm (Adobe Times)\n\n"\
54 " -n, --fontname Font name, e.g. Adobe Times\n\n"\
55 " -c, --fontcommand Name of the command that will switch to the font\n\n"\
56 " -P, --fontscaleprefix prefix of the scale macro, which should be different\n"\
57 " for each font (no digits allowed)\n\n"\
58 " -t, --fonttype Font type (pst1(default)|ttf|otf)\n\n"\
59 " -p, --packagename Name of the LaTeX package\n\n"\
60 " -d, --packagedate Date of the LaTeX package\n\n"\
61 " -v, --packageversion Version of the LaTeX package\n\n"\
62 " -l, --localtexmf root of your local TeX tree, e.g. /cygdrive/c/LocalTeXMF\n\n"\
63 " -m, --mapfilename file name of the map file\n\n"\
64 " -O. --origfontname use original font names instead of Karl Berry names\n\n"\
65 " -s, --fontsubdir location where the fonts and support files should be\n"\
66 " installed, e.g. MyFonts/AdobeTimes\n\n"\
67 " -e, --fontencoding encoding of the font\n"\
68 " (default: 8a (AdobeStandardEncoding))\n\n"\
69 " -o, --otffontfeatures choosing Opentype font features\n"\
70 " (default: -fkern -fliga)\n\n"\
71 " -u, --uninstall will uninstall the font family. You must specify\n"\
72 " --localtexmf and --fontsubdir\n\n"\
73 " -R, --rmdefault installs font family as roman (serif) font family (default)\n\n"\
74 " -S, --sfdefault installs font family as sans serif font family\n\n"\
75 " -T, --ttdefault installs font family as typewriter font family\n\n"\
76 " -V, --version will print the version number of `basenamescip-shell system . . basename. $0`\n\n"\
77 " -L, --log will write the terminal output of the main programms into the\n"\
78 " LOG file instead of the screen\n\n"\
79 " -h, --help will print this help statement\n\n"\
80 " See http://latex.josef-kleber.de/index.htm or\n"\
81 " http://latex.josef-kleber.de/en_index.htm\n"\
82 " for more information"
83 exit 0;
84 }
85 function printVersionscip-shell shell texlive-bin 2026.20260303.78225+ds-4 printVersion().()
86 {
87 echoscip-shell system . . echo. "This is version $VERSION of `basenamescip-shell system . . basename. $0`"
88 exit 0;
89 }
90 #
91 if [scip-shell system . . `[`. $# -eq 0 ]
92 then
93 echoscip-shell system . . echo. -e "`basenamescip-shell system . . basename. $0`: Could not find command line arguments.\nUse the '--help' option for explanation."
94 echoscip-shell system . . echo. -e "Continue with default script variables? (y/n)"
95 read ANSWER
96 if [scip-shell system . . `[`. $ANSWER = "n" -o $ANSWER = "N" ]
97 then
98 exit 1
99 fi
100 fi
101 #
102 LONGOPTS="fontfamily:,fontname:,fontcommand:,fontscaleprefix:,fonttype:,packagename:,packagedate:,packageversion:,mapfilename:,origfilename,localtexmf:,fontsubdir:,fontencoding:,otffontfeatures:,uninstall,rmdefault,sfdefault,ttdefault,log,version,help"
103 SHORTOPTS="f:n:c:P:t:p:d:v:m:Ol:s:e:o:uRSTVLh"
104 ARGS=$(getoptscip-shell system . . getopt. -l "$LONGOPTS" "$SHORTOPTS" "$@")
105 if [scip-shell system . . `[`. $? -ne 0 ]
106 then
107 echoscip-shell system . . echo. -e "`basenamescip-shell system . . basename. $0`: Could not process command line arguments.\nUse the '--help' option for explanation."
108 exit 1
109 fi
110 #
111 eval set -- "$ARGS"
112 #
113 while [scip-shell system . . `[`. $# -gt 0 ]; do
114 ARG=$1
115 case "$ARG" in
116 --help|-h) shift; printHelpscip-shell shell texlive-bin 2026.20260303.78225+ds-4 printHelp().;;
117 --version|-V) shift; printVersionscip-shell shell texlive-bin 2026.20260303.78225+ds-4 printVersion().;;
118 --rmdefault|-R) shift; INSTALLAS="rmdefault";;
119 --sfdefault|-S) shift; INSTALLAS="sfdefault";;
120 --ttdefault|-T) shift; INSTALLAS="ttdefault";;
121 --uninstall|-u) shift; UNINSTALL="true";;
122 --log|-L) shift; LOG="true";;
123 --fontfamily|-f) shift; FONTFAMILY="$1"; shift;;
124 --fontname|-n) shift; FONTNAME="$1"; shift;;
125 --fontcommand|-c) shift; FONTCOMMAND="$1"; shift;;
126 --fontscaleprefix|-P) shift; FONTSCALEPREFIX="$1"; shift;;
127 --fonttype|-t) shift; FONTTYPE="$1"; shift;;
128 --packagename|-p) shift; PACKAGENAME="$1"; shift;;
129 --packagedate|-d) shift; PACKAGEDATE="$1"; shift;;
130 --packageversion|-v) shift; PACKAGEVERSION="$1"; shift;;
131 --mapfilename|-m) shift; MAPFILENAME="$1"; shift;;
132 --origfontname|-O) shift; OFN="true";;
133 --localtexmf|-l) shift; LOCALTEXMF="$1"; shift;;
134 --fontsubdir|-s) shift; FONTSUBDIR="$1"; shift;;
135 --fontencoding|-e) shift; FONTENCODING="$1"; shift;;
136 --otffontfeatures|-o) shift; FONTFAMILY="$1"; shift;;
137 --) shift; break;;
138 *) break;;
139 esac
140 done
141 #
142 rmscip-shell system . . rm. LOG 2>>/dev/nullscip-shell filesystem . . `/dev/null`.;
143 #
144 if [scip-shell system . . `[`. -z $MAPFILENAME ]
145 then
146 MAPFILENAME=$FONTFAMILY
147 fi
148 #
149 typeset -i STEP=0
150 #
151 if [scip-shell system . . `[`. $UNINSTALL = "true" ]
152 then
153 DIR="${LOCALTEXMF}/fonts/tfm/${FONTSUBDIR}/"
154 echoscip-shell system . . echo. -e "$\n\n$DIR"
155 DIR="${LOCALTEXMF}/fonts/vf/${FONTSUBDIR}/"
156 echoscip-shell system . . echo. $DIR
157 DIR="${LOCALTEXMF}/fonts/type1/${FONTSUBDIR}/"
158 echoscip-shell system . . echo. $DIR
159 DIR="${LOCALTEXMF}/fonts/map/dvips/${FONTSUBDIR}/"
160 echoscip-shell system . . echo. $DIR
161 DIR="${LOCALTEXMF}/tex/latex/${FONTSUBDIR}/"
162 echoscip-shell system . . echo. $DIR
163 echoscip-shell system . . echo. -e "\n\nDo you want to delete these directories? (y/n)"
164 read ANSWER
165 if [scip-shell system . . `[`. $ANSWER = "y" -o $ANSWER = "Y" ]
166 then
167 DIR="${LOCALTEXMF}/fonts/tfm/${FONTSUBDIR}/"
168 rmscip-shell system . . rm. -f -r $DIR
169 DIR="${LOCALTEXMF}/fonts/vf/${FONTSUBDIR}/"
170 rmscip-shell system . . rm. -f -r $DIR
171 DIR="${LOCALTEXMF}/fonts/type1/${FONTSUBDIR}/"
172 rmscip-shell system . . rm. -f -r $DIR
173 DIR="${LOCALTEXMF}/fonts/map/dvips/${FONTSUBDIR}/"
174 rmscip-shell system . . rm. -f -r $DIR
175 DIR="${LOCALTEXMF}/tex/latex/${FONTSUBDIR}/"
176 rmscip-shell system . . rm. -f -r $DIR
177 exit 0
178 else
179 exit 1
180 fi
181 fi
182 #
183 if [scip-shell system . . `[`. $FONTTYPE = "ttf" ]
184 then
185 ((STEP++))
186 echoscip-shell system . . echo. -e "\n\n$STEP) Convert font(s) to Postscript Type1\n\n"
187 for file in *.TTF;
188 do
189 mvscip-shell system . . mv. "$file" "${file%TTF}ttf" 2>>/dev/nullscip-shell filesystem . . `/dev/null`.;
190 done
191 for file in *.ttf;
192 do
193 ttf2pt1 -a -b -l adobestd "$file";
194 done
195 fi
196 #
197 if [scip-shell system . . `[`. $FONTTYPE = "otf" ]
198 then
199 ((STEP++))
200 echoscip-shell system . . echo. -e "\n\n$STEP) Convert font(s) to Postscript Type1\n\n"
201 for file in *.OTF;
202 do
203 mvscip-shell system . . mv. "$file" "${file%OTF}otf" 2>>/dev/nullscip-shell filesystem . . `/dev/null`.;
204 done
205 for file in *.otf;
206 do
207 otftotfm $OTFFONTFEATURES -e - "$file" 555;
208 done
209 for file in *.pfb;
210 do
211 pf2afm "$file";
212 done
213 rmscip-shell system . . rm. *.tfm
214 rmscip-shell system . . rm. *.enc
215 fi
216 #
217 echoscip-shell system . . echo. -e "\n\nTry to rename the font(s) automatically? (y/n)"
218 read ANSWER
219 if [scip-shell system . . `[`. $ANSWER = "y" -o $ANSWER = "Y" ]
220 then
221 ((STEP++))
222 echoscip-shell system . . echo. -e "\n\n$STEP) Renaming fonts\n\n"
223 mkdirscip-shell system . . mkdir. -p Backup
224 cpscip-shell system . . cp. *.afm *.AFM ./Backup 2>>/dev/nullscip-shell filesystem . . `/dev/null`.
225 cpscip-shell system . . cp. *.pfb *.PFB ./Backup 2>>/dev/nullscip-shell filesystem . . `/dev/null`.
226 for file in *.AFM;
227 do
228 mvscip-shell system . . mv. "$file" "${file%AFM}afm" 2>>/dev/nullscip-shell filesystem . . `/dev/null`.;
229 done
230 for file in *.PFB;
231 do
232 mvscip-shell system . . mv. "$file" "${file%PFB}pfb" 2>>/dev/nullscip-shell filesystem . . `/dev/null`.;
233 done
234 FONTNUMBER=$(lsscip-shell system . . ls. -al *.pfb 2>>/dev/nullscip-shell filesystem . . `/dev/null`. | wcscip-shell system . . wc. -l)
235 if [scip-shell system . . `[`. $FONTNUMBER -le 1 ]
236 then
237 if [scip-shell system . . `[`. $FONTNUMBER -eq 0 ]
238 then
239 echoscip-shell system . . echo. "No font(s) to rename!"
240 exit 1
241 else
242 for file in *.afm;
243 do
244 mvscip-shell system . . mv. "$file" ${FONTFAMILY}${FONTCUT}${FONTENCODING}.afm;
245 done
246 for file in *.pfb;
247 do
248 mvscip-shell system . . mv. "$file" ${FONTFAMILY}${FONTCUT}${FONTENCODING}.pfb;
249 echoscip-shell system . . echo. -e "s/<${FONTFAMILY}${FONTCUT}${FONTENCODING}/<${file%.pfb}/" >>map.sed;
250 done
251 fi
252 else
253 mkdirscip-shell system . . mkdir. -p Rename
254 # rename small caps font(s)
255 FILES=$(grepscip-shell system . . grep. -e "Smc" -e "Caps" -e "SCOsF" *.afm | cutscip-shell system . . cut. -d':' -f1 | uniqscip-shell system . . uniq.)
256 for file in $FILES
257 do
258 FONTCUT="rc"
259 FWEIGHT=$(grepscip-shell system . . grep. -e "Light" "$file" | wcscip-shell system . . wc. -l)
260 if [scip-shell system . . `[`. $FWEIGHT -gt 0 ]
261 then
262 FONTCUT="lc"
263 else
264 FWEIGHT=$(grepscip-shell system . . grep. -e "Semibold" -e "SemiBold" "$file" | wcscip-shell system . . wc. -l)
265 if [scip-shell system . . `[`. $FWEIGHT -gt 0 ]
266 then
267 FONTCUT="sc"
268 else
269 FWEIGHT=$(grepscip-shell system . . grep. -e "Demi" -e "Demibold" -e "DemiBold" "$file" | wcscip-shell system . . wc. -l)
270 if [scip-shell system . . `[`. $FWEIGHT -gt 0 ]
271 then
272 FONTCUT="dc"
273 else
274 FWEIGHT=$(grepscip-shell system . . grep. -e "Extrabold" -e "ExtraBold" "$file" | wcscip-shell system . . wc. -l)
275 if [scip-shell system . . `[`. $FWEIGHT -gt 0 ]
276 then
277 FONTCUT="xc"
278 else
279 FWEIGHT=$(grepscip-shell system . . grep. -e "Heavy" -e "Ultrabold" -e "UltraBold" "$file" | wcscip-shell system . . wc. -l)
280 if [scip-shell system . . `[`. $FWEIGHT -gt 0 ]
281 then
282 FONTCUT="uc"
283 else
284 FWEIGHT=$(grepscip-shell system . . grep. -e "Bold" -e "bold" "$file" | wcscip-shell system . . wc. -l)
285 if [scip-shell system . . `[`. $FWEIGHT -gt 0 ]
286 then
287 FONTCUT="bc"
288 fi
289 fi
290 fi
291 fi
292 fi
293 fi
294 mvscip-shell system . . mv. "$file" ./Rename/${FONTFAMILY}${FONTCUT}${FONTENCODING}.afm;
295 mvscip-shell system . . mv. "${file%afm}pfb" ./Rename/${FONTFAMILY}${FONTCUT}${FONTENCODING}.pfb;
296 echoscip-shell system . . echo. -e "s/<${FONTFAMILY}${FONTCUT}${FONTENCODING}/<${file%.afm}/" >>map.sed;
297 done
298 # rename the extra light font(s)
299 FILES=$(grepscip-shell system . . grep. -e "XLight" -e "Xlight" -e "extra light" *.afm | cutscip-shell system . . cut. -d':' -f1 | uniqscip-shell system . . uniq.)
300 for file in $FILES
301 do
302 ITALICANGLE=$(grepscip-shell system . . grep. -e "ItalicAngle" "$file" | trscip-shell system . . tr. ' ' '+' | cutscip-shell system . . cut. -d'+' -f2 | cutscip-shell system . . cut. -d'.' -f1)
303 if [scip-shell system . . `[`. $ITALICANGLE -lt 0 -o $ITALICANGLE -gt 0 ]
304 then
305 FONTCUT="ji"
306 else
307 FONTCUT="j"
308 fi
309 mvscip-shell system . . mv. "$file" ./Rename/${FONTFAMILY}${FONTCUT}${FONTENCODING}.afm;
310 mvscip-shell system . . mv. "${file%afm}pfb" ./Rename/${FONTFAMILY}${FONTCUT}${FONTENCODING}.pfb;
311 echoscip-shell system . . echo. -e "s/<${FONTFAMILY}${FONTCUT}${FONTENCODING}/<${file%.afm}/" >>map.sed;
312 SMFFSTY="\RequirePackage{softmakerfreefont}%"
313 done
314 # rename the light font(s)
315 FILES=$(grepscip-shell system . . grep. -e "Light" *.afm | cutscip-shell system . . cut. -d':' -f1 | uniqscip-shell system . . uniq.)
316 for file in $FILES
317 do
318 ITALICANGLE=$(grepscip-shell system . . grep. -e "ItalicAngle" "$file" | trscip-shell system . . tr. ' ' '+' | cutscip-shell system . . cut. -d'+' -f2 | cutscip-shell system . . cut. -d'.' -f1)
319 if [scip-shell system . . `[`. $ITALICANGLE -lt 0 -o $ITALICANGLE -gt 0 ]
320 then
321 FONTCUT="li"
322 else
323 FONTCUT="l"
324 fi
325 mvscip-shell system . . mv. "$file" ./Rename/${FONTFAMILY}${FONTCUT}${FONTENCODING}.afm;
326 mvscip-shell system . . mv. "${file%afm}pfb" ./Rename/${FONTFAMILY}${FONTCUT}${FONTENCODING}.pfb;
327 echoscip-shell system . . echo. -e "s/<${FONTFAMILY}${FONTCUT}${FONTENCODING}/<${file%.afm}/" >>map.sed;
328 SMFFSTY="\RequirePackage{softmakerfreefont}%"
329 done
330 # rename the semi(bold) font
331 FILES=$(grepscip-shell system . . grep. -e "Semibold" -e "SemiBold" *.afm | cutscip-shell system . . cut. -d':' -f1 | uniqscip-shell system . . uniq.)
332 for file in $FILES
333 do
334 ITALICANGLE=$(grepscip-shell system . . grep. -e "ItalicAngle" "$file" | trscip-shell system . . tr. ' ' '+' | cutscip-shell system . . cut. -d'+' -f2 | cutscip-shell system . . cut. -d'.' -f1)
335 if [scip-shell system . . `[`. $ITALICANGLE -lt 0 -o $ITALICANGLE -gt 0 ]
336 then
337 FONTCUT="si"
338 else
339 FONTCUT="s"
340 fi
341 mvscip-shell system . . mv. "$file" ./Rename/${FONTFAMILY}${FONTCUT}${FONTENCODING}.afm;
342 mvscip-shell system . . mv. "${file%afm}pfb" ./Rename/${FONTFAMILY}${FONTCUT}${FONTENCODING}.pfb;
343 echoscip-shell system . . echo. -e "s/<${FONTFAMILY}${FONTCUT}${FONTENCODING}/<${file%.afm}/" >>map.sed;
344 SMFFSTY="\RequirePackage{softmakerfreefont}%"
345 done
346 # rename the demi(bold) font
347 FILES=$(grepscip-shell system . . grep. -e "FontName" -e "FullName" *.afm | grepscip-shell system . . grep. -e "Demi" -e "Demibold" -e "DemiBold" | cutscip-shell system . . cut. -d':' -f1 | uniqscip-shell system . . uniq.)
348 for file in $FILES
349 do
350 ITALICANGLE=$(grepscip-shell system . . grep. -e "ItalicAngle" "$file" | trscip-shell system . . tr. ' ' '+' | cutscip-shell system . . cut. -d'+' -f2 | cutscip-shell system . . cut. -d'.' -f1)
351 if [scip-shell system . . `[`. $ITALICANGLE -lt 0 -o $ITALICANGLE -gt 0 ]
352 then
353 FONTCUT="di"
354 else
355 FONTCUT="d"
356 fi
357 mvscip-shell system . . mv. "$file" ./Rename/${FONTFAMILY}${FONTCUT}${FONTENCODING}.afm;
358 mvscip-shell system . . mv. "${file%afm}pfb" ./Rename/${FONTFAMILY}${FONTCUT}${FONTENCODING}.pfb;
359 echoscip-shell system . . echo. -e "s/<${FONTFAMILY}${FONTCUT}${FONTENCODING}/<${file%.afm}/" >>map.sed;
360 SMFFSTY="\RequirePackage{softmakerfreefont}%"
361 done
362 # rename the extra bold font
363 FILES=$(grepscip-shell system . . grep. -e "Extrabold" -e "ExtraBold" *.afm | cutscip-shell system . . cut. -d':' -f1 | uniqscip-shell system . . uniq.)
364 for file in $FILES
365 do
366 ITALICANGLE=$(grepscip-shell system . . grep. -e "ItalicAngle" "$file" | trscip-shell system . . tr. ' ' '+' | cutscip-shell system . . cut. -d'+' -f2 | cutscip-shell system . . cut. -d'.' -f1)
367 if [scip-shell system . . `[`. $ITALICANGLE -lt 0 -o $ITALICANGLE -gt 0 ]
368 then
369 FONTCUT="xi"
370 else
371 FONTCUT="x"
372 fi
373 mvscip-shell system . . mv. "$file" ./Rename/${FONTFAMILY}${FONTCUT}${FONTENCODING}.afm;
374 mvscip-shell system . . mv. "${file%afm}pfb" ./Rename/${FONTFAMILY}${FONTCUT}${FONTENCODING}.pfb;
375 echoscip-shell system . . echo. -e "s/<${FONTFAMILY}${FONTCUT}${FONTENCODING}/<${file%.afm}/" >>map.sed;
376 done
377 # rename the ultra bold/heavy font
378 FILES=$(grepscip-shell system . . grep. -e "Heavy" -e "Ultrabold" -e "UltraBold" *.afm | cutscip-shell system . . cut. -d':' -f1 | uniqscip-shell system . . uniq.)
379 for file in $FILES
380 do
381 ITALICANGLE=$(grepscip-shell system . . grep. -e "ItalicAngle" "$file" | trscip-shell system . . tr. ' ' '+' | cutscip-shell system . . cut. -d'+' -f2 | cutscip-shell system . . cut. -d'.' -f1)
382 if [scip-shell system . . `[`. $ITALICANGLE -lt 0 -o $ITALICANGLE -gt 0 ]
383 then
384 FONTCUT="ui"
385 else
386 FONTCUT="u"
387 fi
388 mvscip-shell system . . mv. "$file" ./Rename/${FONTFAMILY}${FONTCUT}${FONTENCODING}.afm;
389 mvscip-shell system . . mv. "${file%afm}pfb" ./Rename/${FONTFAMILY}${FONTCUT}${FONTENCODING}.pfb;
390 echoscip-shell system . . echo. -e "s/<${FONTFAMILY}${FONTCUT}${FONTENCODING}/<${file%.afm}/" >>map.sed;
391 SMFFSTY="\RequirePackage{softmakerfreefont}%"
392 done
393 # rename the bold font
394 FILES=$(grepscip-shell system . . grep. -e "Bold" -e "bold" *.afm | cutscip-shell system . . cut. -d':' -f1 | uniqscip-shell system . . uniq.)
395 for file in $FILES
396 do
397 ITALICANGLE=$(grepscip-shell system . . grep. -e "ItalicAngle" "$file" | trscip-shell system . . tr. ' ' '+' | cutscip-shell system . . cut. -d'+' -f2 | cutscip-shell system . . cut. -d'.' -f1)
398 if [scip-shell system . . `[`. $ITALICANGLE -lt 0 -o $ITALICANGLE -gt 0 ]
399 then
400 FONTCUT="bi"
401 else
402 FONTCUT="b"
403 fi
404 mvscip-shell system . . mv. "$file" ./Rename/${FONTFAMILY}${FONTCUT}${FONTENCODING}.afm;
405 mvscip-shell system . . mv. "${file%afm}pfb" ./Rename/${FONTFAMILY}${FONTCUT}${FONTENCODING}.pfb;
406 echoscip-shell system . . echo. -e "s/<${FONTFAMILY}${FONTCUT}${FONTENCODING}/<${file%.afm}/" >>map.sed;
407 done
408 # rename the regular font
409 FILES=$(grepscip-shell system . . grep. -e "Regular" -e "Medium" -e "Book" --exclude=installfont * | grepscip-shell system . . grep. -e ".afm" | cutscip-shell system . . cut. -d':' -f1 | uniqscip-shell system . . uniq.)
410 for file in $FILES
411 do
412 ITALICANGLE=$(grepscip-shell system . . grep. -e "ItalicAngle" "$file" | trscip-shell system . . tr. ' ' '+' | cutscip-shell system . . cut. -d'+' -f2 | cutscip-shell system . . cut. -d'.' -f1)
413 if [scip-shell system . . `[`. $ITALICANGLE -lt 0 -o $ITALICANGLE -gt 0 ]
414 then
415 FONTCUT="ri"
416 else
417 FONTCUT="r"
418 fi
419 mvscip-shell system . . mv. "$file" ./Rename/${FONTFAMILY}${FONTCUT}${FONTENCODING}.afm;
420 mvscip-shell system . . mv. "${file%afm}pfb" ./Rename/${FONTFAMILY}${FONTCUT}${FONTENCODING}.pfb;
421 echoscip-shell system . . echo. -e "s/<${FONTFAMILY}${FONTCUT}${FONTENCODING}/<${file%.afm}/" >>map.sed;
422 done
423 mvscip-shell system . . mv. ./Rename/* .
424 rmdirscip-shell system . . rmdir. ./Rename
425 fi
426 lsscip-shell system . . ls. -al *.pfb *.afm
427 echoscip-shell system . . echo. -e "\n\nPlease check the font name(s). Continue? (y/n)"
428 read ANSWER
429 if [scip-shell system . . `[`. $ANSWER = "n" -o $ANSWER = "N" ]
430 then
431 rmscip-shell system . . rm. *.afm
432 rmscip-shell system . . rm. *.pfb
433 rmscip-shell system . . rm. *.sed
434 mvscip-shell system . . mv. ./Backup/* .
435 rmdirscip-shell system . . rmdir. ./Backup
436 exit 1
437 fi
438 fi
439 #
440 ((STEP++))
441 echoscip-shell system . . echo. -e "\n\n$STEP) Creating metrics and virtual fonts\n\n"
442 catscip-shell system . . cat. >${FONTFAMILY}-drv.tex <<EOF
443 \input fontinst.sty
444 \needsfontinstversion{1.926}
445 \recordtransforms{${FONTFAMILY}-rec.tex}
446 \latinfamily{${FONTFAMILY}}{}
447 \endrecordtransforms
448 \bye
449 EOF
450 if [scip-shell system . . `[`. $LOG = "true" ]
451 then
452 tex ${FONTFAMILY}-drv.tex >>LOG 2>&1
453 else
454 tex ${FONTFAMILY}-drv.tex
455 fi
456 #
457 ((STEP++))
458 echoscip-shell system . . echo. -e "\n\n$STEP) Compiling metrics and virtual fonts\n\n"
459 for file in *.pl;
460 do
461 if [scip-shell system . . `[`. $LOG = "true" ]
462 then
463 pltotf $file ${file%pl}tfm >>LOG 2>&1
464 else
465 pltotf $file ${file%pl}tfm
466 fi
467 done
468 for file in *.vpl;
469 do
470 if [scip-shell system . . `[`. $LOG = "true" ]
471 then
472 vptovf $file ${file%vpl}vf ${file%vpl}tfm >>LOG 2>&1
473 else
474 vptovf $file ${file%vpl}vf ${file%vpl}tfm
475 fi
476 done
477 #
478 ((STEP++))
479 echoscip-shell system . . echo. -e "\n\n$STEP) Creating the map file\n\n"
480 catscip-shell system . . cat. >${FONTFAMILY}-map.tex <<EOF
481 \input finstmsc.sty
482 \resetstr{PSfontsuffix}{.pfb}
483 \adddriver{dvips}{${FONTFAMILY}.map}
484 \input ${FONTFAMILY}-rec.tex
485 \donedrivers
486 \bye
487 EOF
488 if [scip-shell system . . `[`. $LOG = "true" ]
489 then
490 tex ${FONTFAMILY}-map.tex >>LOG 2>&1
491 else
492 tex ${FONTFAMILY}-map.tex
493 fi
494 if [scip-shell system . . `[`. $OFN = "true" ]
495 then
496 sedscip-shell system . . sed. -f map.sed ${FONTFAMILY}.map >${MAPFILENAME}.map
497 unix2dos ${MAPFILENAME}.map 2>>/dev/nullscip-shell filesystem . . `/dev/null`.;
498 rmscip-shell system . . rm. ${FONTFAMILY}.map
499 UMAP="${MAPFILENAME}"
500 else
501 UMAP="${FONTFAMILY}"
502 fi
503 #
504 ((STEP++))
505 echoscip-shell system . . echo. -e "\n\n$STEP) Creating the style file"
506 catscip-shell system . . cat. >${PACKAGENAME}.sty <<EOF
507 \NeedsTeXFormat{LaTeX2e}%
508 \ProvidesPackage{$PACKAGENAME}[$PACKAGEDATE $PACKAGEVERSION $FONTNAME]%
509 \RequirePackage{textcomp}%
510 \RequirePackage{xkeyval}%
511 \define@key{${PACKAGENAME}.sty}{scaled}[1.0]%
512 {%
513 \def\\${FONTSCALEPREFIX}@scale{#1}%
514 }%
515 \define@key{${PACKAGENAME}.sty}{leading}[1.0]%
516 {%
517 \linespread{#1}%
518 }%
519 \ExecuteOptionsX{scaled}%
520 \ProcessOptionsX\relax%
521 \renewcommand*{\\${INSTALLAS}}{$FONTFAMILY}%
522 \newcommand\\${FONTCOMMAND}{\fontfamily{$FONTFAMILY}\fontseries{m}\fontshape{n}\selectfont}%
523 \endinput%
524 EOF
525 #
526 ((STEP++))
527 echoscip-shell system . . echo. -e "\n\n$STEP) Insert scale factor into the fd files"
528 catscip-shell system . . cat. >installfont.sed <<EOF
529 9 i\\
530 \\n\\\\expandafter\\\\ifx\\\\csname ${FONTSCALEPREFIX}@scale\\\\endcsname\\\\relax\\n \\\\let\\\\${FONTSCALEPREFIX}@@scale\\\\@empty\\n\\\\else\\n \\\\edef\\\\${FONTSCALEPREFIX}@@scale{s*[\\\\csname ${FONTSCALEPREFIX}@scale\\\\endcsname]}\\n\\\\fi\\n
531 s/<-> /<-> \\\\${FONTSCALEPREFIX}@@scale /
532 EOF
533 #
534 for file in *.fd;
535 do
536 mvscip-shell system . . mv. $file ${file%fd}fdb;
537 sedscip-shell system . . sed. -f installfont.sed ${file%fd}fdb >$file;
538 done
539 #
540 ((STEP++))
541 echoscip-shell system . . echo. -e "\n\n$STEP) Installing font(s) and support files"
542 DIR="${LOCALTEXMF}/fonts/tfm/${FONTSUBDIR}/"
543 if [scip-shell system . . `[`. ! -d $DIR ]
544 then
545 mkdirscip-shell system . . mkdir. -p $DIR
546 fi
547 mvscip-shell system . . mv. *.tfm $DIR
548 DIR="${LOCALTEXMF}/fonts/vf/${FONTSUBDIR}/"
549 if [scip-shell system . . `[`. ! -d $DIR ]
550 then
551 mkdirscip-shell system . . mkdir. -p $DIR
552 fi
553 mvscip-shell system . . mv. *.vf $DIR
554 DIR="${LOCALTEXMF}/fonts/type1/${FONTSUBDIR}/"
555 if [scip-shell system . . `[`. $OFN = "true" ]
556 then
557 cd Backup
558 if [scip-shell system . . `[`. ! -d $DIR ]
559 then
560 mkdirscip-shell system . . mkdir. -p $DIR
561 fi
562 cpscip-shell system . . cp. *.pfb $DIR
563 cd ..
564 else
565 if [scip-shell system . . `[`. ! -d $DIR ]
566 then
567 mkdirscip-shell system . . mkdir. -p $DIR
568 fi
569 cpscip-shell system . . cp. *.pfb $DIR
570 fi
571 DIR="${LOCALTEXMF}/fonts/map/dvips/${FONTSUBDIR}/"
572 if [scip-shell system . . `[`. ! -d $DIR ]
573 then
574 mkdirscip-shell system . . mkdir. -p $DIR
575 fi
576 mvscip-shell system . . mv. *.map $DIR
577 DIR="${LOCALTEXMF}/tex/latex/${FONTSUBDIR}/"
578 if [scip-shell system . . `[`. ! -d $DIR ]
579 then
580 mkdirscip-shell system . . mkdir. -p $DIR
581 fi
582 mvscip-shell system . . mv. *.fd $DIR
583 DIR="${LOCALTEXMF}/tex/latex/${FONTSUBDIR}/"
584 if [scip-shell system . . `[`. ! -d $DIR ]
585 then
586 mkdirscip-shell system . . mkdir. -p $DIR
587 fi
588 mvscip-shell system . . mv. *.sty $DIR
589 #
590 ((STEP++))
591 echoscip-shell system . . echo. -e "\n\n$STEP) Update FNDB"
592 echoscip-shell system . . echo. -e "\n\n"
593 texhash
594 #
595 ((STEP++))
596 echoscip-shell system . . echo. -e "\n\n$STEP) Include the map file"
597 echoscip-shell system . . echo. -e "\n\n"
598 updmap --enable Map ${UMAP}.map
599 rmscip-shell system . . rm. *.mtx
600 rmscip-shell system . . rm. *.pl
601 rmscip-shell system . . rm. *.vpl
602 rmscip-shell system . . rm. *.log
603 rmscip-shell system . . rm. *.tex
604 rmscip-shell system . . rm. *.fdb
605 rmscip-shell system . . rm. *.sed
606 if [scip-shell system . . `[`. -d Backup ]
607 then
608 rmscip-shell system . . rm. *.afm
609 rmscip-shell system . . rm. *.pfb
610 mvscip-shell system . . mv. ./Backup/* .
611 rmdirscip-shell system . . rmdir. ./Backup
612 fi
613 echoscip-shell system . . echo. -e "\n\nThe font(s) should be installed now!"
614 exit 0