summaryrefslogtreecommitdiff
path: root/japanese/vfxdvi300/files/customize.sh
blob: acbd52c4af703da56a5f04e6ed9e43bb0a754902 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
#!/bin/sh
# usage sh customize.sh ${RESOLUTION} [BATCH]

DEFAULT_FONT_PATH=.:/usr/local/lib/fonts/pk$1:/usr/local/share/tex/jfonts/jfms:/usr/local/lib/texmf/fonts/public/ptex/tfm:/usr/local/share/texmf/fonts/tfm/ptex

DONE=no
if [ $# = 2 ] ; then
	DONE=yes
fi

echo "Check directory for pkfonts (resolution:$1) and ASCII jTeX's tfm files."
echo
echo "Default is .:/usr/local/lib/fonts/pk$1:/usr/local/share/tex/jfonts/jfms:\\"
echo "		:/usr/local/lib/texmf/fonts/public/ptex/tfm:/usr/local/share/texmf/fonts/tfm/ptex"
echo "If you use jlatex of ports collection, it should be OK."
echo

while [ "$DONE" != "yes" ]
do
	echo "Is it OK (y/n)[y]?"
	read ans
	case x"${ans}" in
	xN*|xn*)
		echo "Type DEFAULT_FONT_PATH:"
		read DEFAULT_FONT_PATH
		echo
		echo "DEFAULT_FONT_PATH=${DEFAULT_FONT_PATH}"
	;;
	*)
		DONE=yes
	;;
	esac
done
echo "DEFAULT_FONT_PATH=${DEFAULT_FONT_PATH}"

CHANGE=`echo ${DEFAULT_FONT_PATH} | sed -e 's/\//\\\\\//g'`

cp Imakefile Imakefile.tmp
cat Imakefile.tmp \
| sed -e "s/DEFAULT_FONT_SIZES=FontSizes300/DEFAULT_FONT_SIZES=FontSizes$1/g"\
| sed -e "s/-DBDPI=300/-DBDPI=$1/g"\
| sed -e "s/DEFAULT_FONT_PATH=CHANGE/DEFAULT_FONT_PATH=${CHANGE}/g" \
> Imakefile
rm Imakefile.tmp

if [ $1 = "360" ] || [ $1 = "400" ] || [ $1 = "600" ] ; then
	echo "Default shrink level is set to 5."
cp Imakefile Imakefile.tmp
cat Imakefile.tmp \
| sed -e 's/DEFAULT_SHRINK=\\\"4\\\"/DEFAULT_SHRINK=\\\"5\\\"/g' \
> Imakefile
rm Imakefile.tmp
fi

if [ $# = 1 ] ; then
echo
echo "Do you like to customize Imakefile again by yourself (y/n)[no]?"
read ans
case x"${ans}" in
	xY*|xy*)
	if [ ${EDITOR} ] ; then
		${EDITOR} Imakefile
	else
		vi Imakefile
	fi
	;;
esac
fi