tentative fix for issue 3 (ex 53)
[mplib] / src / texk / kpathsea / mktexnam.opt
1 # mktexnam.opt to determine various manipulations of the filenames.
2 # Sourced from mktexnam.
3
4 # te@dbs.uni-hannover.de and kb@mail.tug.org. Public domain.
5 # $Id: mktexnam.opt,v 1.14 2004/12/28 20:58:18 olaf Exp $
6
7 # Get 8.3 filenames like dpiNNN/NAME.pk.
8 case "$MT_FEATURES" in
9   *dosnames*) MT_PKBASE='dpi$DPI/$NAME.pk';;
10 esac
11
12 # Omit the mode directory (e.g., ljfour):
13 case "$MT_FEATURES" in
14   *nomode*) MODE="";;
15 esac
16
17 ###########################################################################
18 # Use this feature if you wish to use the alias files from the 
19 # ftp://ftp.tug.org/tex/fontname.tar.gz distribution.
20 ###########################################################################
21 case "$MT_FEATURES" in
22 *fontmaps*)
23     MT_NAMEPART='$MT_SUPPLIER/$MT_TYPEFACE'
24     MT_PKDESTREL='pk/$MT_MODE/$MT_NAMEPART'
25     MT_TFMDESTREL='tfm/$MT_NAMEPART'
26     MT_MFDESTREL='source/$MT_NAMEPART'
27     SPECIALMAP=`kpsewhich special.map`
28     TYPEFACEMAP=`kpsewhich typeface.map`
29     SUPPLIERMAP=`kpsewhich supplier.map`
30     if test -r "$SPECIALMAP"; then
31       set x `awk \
32     '{if ($1 == NAME || (substr (NAME, 1, length ($1)) == $1 \
33                       && substr (NAME, length (NAME), 1) ~ /[0-9]/ \
34                       && substr ($1, length ($1), 1) ~ /[^0-9]/)) \
35      { print $2 " " $3; exit; }}' NAME=$NAME "$SPECIALMAP"`
36       shift; SUPPLIER=$1; TYPEFACE=$2
37     
38       if test -z "$SUPPLIER"; then
39         # Try the normal case. Source first.
40         # $NAME might be raw.
41         name=`echo $NAME | sed 's/^r//'`
42         s_abbrev=`echo $name | sed 's/^\(.\).*$/\1/'`
43         SUPPLIER=`awk '{ if ($1 == s_abbrev) { print $2; exit; }}' \
44                    s_abbrev=$s_abbrev "$SUPPLIERMAP"`
45         if test -n "$SUPPLIER"; then
46           # We found the source. Try for the typeface.
47           t_abbrev=`echo $name | sed 's/^.//;s/\(..\).*$/\1/'`
48           TYPEFACE=`awk '{ if ($1 == t_abbrev) { print $2; exit; }}' \
49                        t_abbrev=$t_abbrev "$TYPEFACEMAP"`
50         fi
51       fi
52     fi
53     
54     if test -z "$SUPPLIER"; then
55       echo "$0: Could not map source abbreviation $s_abbrev for $NAME." >&2
56       echo "$0: Need to update $SPECIALMAP?" >&2
57     else
58       MT_SUPPLIER="$SUPPLIER"
59       if test -z "$TYPEFACE"; then
60         echo "$0: Could not map typeface abbreviation $t_abbrev for $NAME." >&2
61         echo "$0: Need to update $SPECIALMAP?" >&2
62       else
63         MT_TYPEFACE="$TYPEFACE"
64       fi
65     fi
66 esac
67
68 ###########################################################################
69 # Use this feature to strip the "supplier" part (e.g. ams)
70 # of the target name:
71 ###########################################################################
72
73 case "$MT_FEATURES" in
74 *stripsupplier*)
75     MT_SUPPLIER=""
76 esac
77
78 ###########################################################################
79 # Use this feature to strip the "typeface" part (e.g. euler)
80 # of the target name:
81 ###########################################################################
82
83 case "$MT_FEATURES" in
84 *striptypeface*)
85     MT_TYPEFACE=""
86 esac
87
88 # Put new fonts into the directory named by the VARTEXFONTS environment
89 # variable or config file value.  (A default value for VARTEXFONTS is
90 # already set in the default texmf.cnf, q.v.)
91
92 # A user can override this setting in either direction by setting
93 # USE_VARTEXFONTS to 1 or 0.
94 case "$MT_FEATURES" in
95   *varfonts*) test "$USE_VARTEXFONTS" != 0 && USE_VARTEXFONTS=1;;
96 esac
97
98 # Force generated files that would go into a system tree (as defined by
99 # SYSTEXMF) into TEXMFVAR. Starting with teTeX-3.0, the variable TEXMFVAR
100 # is always set.  The varfonts feature takes precedence if also set.
101 #
102 # A user can override this setting in either direction by setting
103 # USE_TEXMFVAR to 1 or 0.
104 case "$MT_FEATURES" in
105   *texmfvar*) test "$USE_TEXMFVAR" != 0 && USE_TEXMFVAR=1;;
106 esac