summaryrefslogtreecommitdiff
path: root/Master/texmf-dist/scripts/installfont/installfont-tl
diff options
context:
space:
mode:
authorKarl Berry <karl@freefriends.org>2010-09-22 00:15:14 +0000
committerKarl Berry <karl@freefriends.org>2010-09-22 00:15:14 +0000
commita232fab77596af31c26e3cb455b4c2a82f9d37ff (patch)
treec55aad6faebea7d9117455fb089ca41543afcbdf /Master/texmf-dist/scripts/installfont/installfont-tl
parent8aaf949df71c7524defe6b61d9264f49e41b1b72 (diff)
installfont (22sep10)
git-svn-id: svn://tug.org/texlive/trunk@19837 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master/texmf-dist/scripts/installfont/installfont-tl')
-rwxr-xr-xMaster/texmf-dist/scripts/installfont/installfont-tl88
1 files changed, 68 insertions, 20 deletions
diff --git a/Master/texmf-dist/scripts/installfont/installfont-tl b/Master/texmf-dist/scripts/installfont/installfont-tl
index 703104e262c..d0ff80bb3a3 100755
--- a/Master/texmf-dist/scripts/installfont/installfont-tl
+++ b/Master/texmf-dist/scripts/installfont/installfont-tl
@@ -4,14 +4,14 @@
#
# installs a LaTeX font family (Postscript Type1, Truetype, Opentype)
# (font series from light to ultra bold + (faked) small caps + faked
-# slanted, but no expert fonts) for using with LaTeX (TeXLive)
+# slanted, but no expert fonts) for using them with LaTeX (TeXLive)
# The script tries to rename the fonts automatically (optional).
# Otherwise the *.afm and *.pfb files must be named in Karl Berry scheme
# (e.g. 5bbr8a.pfb)
-# (tested with Ubuntu 9.10) v1.5 (14.09.2010)
+# (tested with Ubuntu 9.10) v1.6 (18.09.2010)
# (C) Josef Kleber, Christoph Bier 2009-2010 License: LPPL
#
-VERSION="v1.5 (2010/09/14)"
+VERSION="v1.6 (2010/09/18)"
#
FONTFAMILY="5bb"
FONTNAME="Softmaker Barbedor"
@@ -33,7 +33,7 @@ FONTCUT="r"
OTFFONTFEATURES="-fkern -fliga"
UNINSTALL="false"
INSTALLAS="rmdefault"
-SMFFSTY="%"
+LOG="false"
#
function printHelp()
{
@@ -65,6 +65,8 @@ function printHelp()
" -S, --sfdefault installs font family as sans serif font family\n\n"\
" -T, --ttdefault installs font family as typewriter font family\n\n"\
" -V, --version will print the version number of `basename $0`\n\n"\
+ " -L, --log will write the terminal output of the main programms into the\n"\
+ " LOG file instead of the screen\n\n"\
" -h, --help will print this help statement\n\n"\
" See http://latex.josef-kleber.de/index.htm or\n"\
" http://latex.josef-kleber.de/en_index.htm\n"\
@@ -88,8 +90,8 @@ then
fi
fi
#
-LONGOPTS="fontfamily:,fontname:,fontcommand:,fontscaleprefix:,fonttype:,packagename:,packagedate:,packageversion:,mapfilename:,origfilename,localtexmf:,fontsubdir:,fontencoding:,otffontfeatures:,uninstall,rmdefault,sfdefault,ttdefault,version,help"
-SHORTOPTS="f:n:c:P:t:p:d:v:m:Ol:s:e:o:uRSTVh"
+LONGOPTS="fontfamily:,fontname:,fontcommand:,fontscaleprefix:,fonttype:,packagename:,packagedate:,packageversion:,mapfilename:,origfilename,localtexmf:,fontsubdir:,fontencoding:,otffontfeatures:,uninstall,rmdefault,sfdefault,ttdefault,log,version,help"
+SHORTOPTS="f:n:c:P:t:p:d:v:m:Ol:s:e:o:uRSTVLh"
ARGS=$(getopt -l "$LONGOPTS" "$SHORTOPTS" "$@")
if [ $? -ne 0 ]
then
@@ -108,6 +110,7 @@ while [ $# -gt 0 ]; do
--sfdefault|-S) shift; INSTALLAS="sfdefault";;
--ttdefault|-T) shift; INSTALLAS="ttdefault";;
--uninstall|-u) shift; UNINSTALL="true";;
+ --log|-L) shift; LOG="true";;
--fontfamily|-f) shift; FONTFAMILY="$1"; shift;;
--fontname|-n) shift; FONTNAME="$1"; shift;;
--fontcommand|-c) shift; FONTCOMMAND="$1"; shift;;
@@ -127,6 +130,8 @@ while [ $# -gt 0 ]; do
esac
done
#
+rm LOG 2>>/dev/null;
+#
if [ -z $MAPFILENAME ]
then
MAPFILENAME=$FONTFAMILY
@@ -241,12 +246,41 @@ then
FILES=$(grep -e "Smc" -e "Caps" -e "SCOsF" *.afm | cut -d':' -f1 | uniq)
for file in $FILES
do
- FWEIGHT=$(grep -e "Weight" "$file" | cut -d' ' -f2 | sed -e "s/\r//")
- if [ $FWEIGHT = "Bold" -o $FWEIGHT = "Xbold" -o $FWEIGHT = "XBold" ]
+ FONTCUT="rc"
+ FWEIGHT=$(grep -e "Light" "$file" | wc -l)
+ if [ $FWEIGHT -gt 0 ]
then
- FONTCUT="bc"
+ FONTCUT="lc"
else
- FONTCUT="rc"
+ FWEIGHT=$(grep -e "Semibold" -e "SemiBold" "$file" | wc -l)
+ if [ $FWEIGHT -gt 0 ]
+ then
+ FONTCUT="sc"
+ else
+ FWEIGHT=$(grep -e "Demi" -e "Demibold" -e "DemiBold" "$file" | wc -l)
+ if [ $FWEIGHT -gt 0 ]
+ then
+ FONTCUT="dc"
+ else
+ FWEIGHT=$(grep -e "Extrabold" -e "ExtraBold" "$file" | wc -l)
+ if [ $FWEIGHT -gt 0 ]
+ then
+ FONTCUT="xc"
+ else
+ FWEIGHT=$(grep -e "Heavy" -e "Ultrabold" -e "UltraBold" "$file" | wc -l)
+ if [ $FWEIGHT -gt 0 ]
+ then
+ FONTCUT="uc"
+ else
+ FWEIGHT=$(grep -e "Bold" -e "bold" "$file" | wc -l)
+ if [ $FWEIGHT -gt 0 ]
+ then
+ FONTCUT="bc"
+ fi
+ fi
+ fi
+ fi
+ fi
fi
mv "$file" ./Rename/${FONTFAMILY}${FONTCUT}${FONTENCODING}.afm;
mv "${file%afm}pfb" ./Rename/${FONTFAMILY}${FONTCUT}${FONTENCODING}.pfb;
@@ -263,7 +297,6 @@ then
else
FONTCUT="l"
fi
- SMFFSTY="\RequirePackage{softmakerfreefont}%"
mv "$file" ./Rename/${FONTFAMILY}${FONTCUT}${FONTENCODING}.afm;
mv "${file%afm}pfb" ./Rename/${FONTFAMILY}${FONTCUT}${FONTENCODING}.pfb;
echo -e "s/<${FONTFAMILY}${FONTCUT}${FONTENCODING}/<${file%.afm}/" >>map.sed;
@@ -279,7 +312,6 @@ then
else
FONTCUT="s"
fi
- SMFFSTY="\RequirePackage{softmakerfreefont}%"
mv "$file" ./Rename/${FONTFAMILY}${FONTCUT}${FONTENCODING}.afm;
mv "${file%afm}pfb" ./Rename/${FONTFAMILY}${FONTCUT}${FONTENCODING}.pfb;
echo -e "s/<${FONTFAMILY}${FONTCUT}${FONTENCODING}/<${file%.afm}/" >>map.sed;
@@ -295,7 +327,6 @@ then
else
FONTCUT="d"
fi
- SMFFSTY="\RequirePackage{softmakerfreefont}%"
mv "$file" ./Rename/${FONTFAMILY}${FONTCUT}${FONTENCODING}.afm;
mv "${file%afm}pfb" ./Rename/${FONTFAMILY}${FONTCUT}${FONTENCODING}.pfb;
echo -e "s/<${FONTFAMILY}${FONTCUT}${FONTENCODING}/<${file%.afm}/" >>map.sed;
@@ -311,7 +342,6 @@ then
else
FONTCUT="x"
fi
- SMFFSTY="\RequirePackage{softmakerfreefont}%"
mv "$file" ./Rename/${FONTFAMILY}${FONTCUT}${FONTENCODING}.afm;
mv "${file%afm}pfb" ./Rename/${FONTFAMILY}${FONTCUT}${FONTENCODING}.pfb;
echo -e "s/<${FONTFAMILY}${FONTCUT}${FONTENCODING}/<${file%.afm}/" >>map.sed;
@@ -327,7 +357,6 @@ then
else
FONTCUT="u"
fi
- SMFFSTY="\RequirePackage{softmakerfreefont}%"
mv "$file" ./Rename/${FONTFAMILY}${FONTCUT}${FONTENCODING}.afm;
mv "${file%afm}pfb" ./Rename/${FONTFAMILY}${FONTCUT}${FONTENCODING}.pfb;
echo -e "s/<${FONTFAMILY}${FONTCUT}${FONTENCODING}/<${file%.afm}/" >>map.sed;
@@ -389,17 +418,32 @@ cat >${FONTFAMILY}-drv.tex <<EOF
\endrecordtransforms
\bye
EOF
-tex ${FONTFAMILY}-drv.tex
+if [ $LOG = "true" ]
+then
+ tex ${FONTFAMILY}-drv.tex >>LOG 2>&1
+else
+ tex ${FONTFAMILY}-drv.tex
+fi
#
((STEP++))
echo -e "\n\n$STEP) Compiling metrics and virtual fonts\n\n"
for file in *.pl;
do
- pltotf $file ${file%pl}tfm;
+ if [ $LOG = "true" ]
+ then
+ pltotf $file ${file%pl}tfm >>LOG 2>&1
+ else
+ pltotf $file ${file%pl}tfm
+ fi
done
for file in *.vpl;
do
- vptovf $file ${file%vpl}vf ${file%vpl}tfm;
+ if [ $LOG = "true" ]
+ then
+ vptovf $file ${file%vpl}vf ${file%vpl}tfm >>LOG 2>&1
+ else
+ vptovf $file ${file%vpl}vf ${file%vpl}tfm
+ fi
done
#
((STEP++))
@@ -412,7 +456,12 @@ cat >${FONTFAMILY}-map.tex <<EOF
\donedrivers
\bye
EOF
-tex ${FONTFAMILY}-map.tex
+if [ $LOG = "true" ]
+then
+ tex ${FONTFAMILY}-map.tex >>LOG 2>&1
+else
+ tex ${FONTFAMILY}-map.tex
+fi
if [ $OFN = "true" ]
then
sed -f map.sed ${FONTFAMILY}.map >${MAPFILENAME}.map
@@ -428,7 +477,6 @@ echo -e "\n\n$STEP) Creating the style file"
cat >${PACKAGENAME}.sty <<EOF
\NeedsTeXFormat{LaTeX2e}%
\ProvidesPackage{$PACKAGENAME}[$PACKAGEDATE $PACKAGEVERSION $FONTNAME]%
-${SMFFSTY}%
\RequirePackage{textcomp}%
\RequirePackage{xkeyval}%
\define@key{${PACKAGENAME}.sty}{scaled}[1.0]%