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