aboutsummaryrefslogtreecommitdiffstats
path: root/chinese/arphicttf/pkg-install
blob: 35212ea489b71cca3f17e9128c68e9152b9aa65b (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
#!/bin/sh

if [ "$2" = "PRE-INSTALL" ]; then
  exit 0
fi

PKGNAME=$1
PREFIX=${PKG_PREFIX}
TTFM=${PREFIX}/bin/ttfm.sh

FONTDIR=${PREFIX}/share/fonts/TrueType
FONTS="bkai00mp.ttf bsmi00lp.ttf gbsn00lp.ttf gkai00mp.ttf"
DEFAULTMING="bsmi00lp.ttf gbsn00lp.ttf"
DEFAULTKAI="bkai00mp.ttf gkai00mp.ttf"

[ "X$WANT_X" = "X" ] && WANT_X=YES

if [ ! -x $TTFM ]; then
    echo "$TTFM not found!"
    exit 1
fi

rm -f $FONTDIR/$PKGNAME

if [ "$WANT_CJK" = "YES" -o "$WANT_CJK" = "yes" ]; then
    # There's no CJK module now.
fi

if [ "$WANT_GS6" = "YES" -o "$WANT_GS6" = "yes" ]; then
    for f in $FONTS; do
        $TTFM --add ghostscript6 $FONTDIR/$f
    done
    for f in $DEFAULTMING; do
        $TTFM --setdefault ghostscript6 $FONTDIR/$f
    done
    for f in $DEFAULTKAI; do
        $TTFM --setdefault_kai ghostscript6 $FONTDIR/$f
    done
    echo "ghostscript6" >> $FONTDIR/$PKGNAME
fi

if [ "$WANT_X" = "YES" -o "$WANT_X" = "yes" ]; then
    for f in $FONTS; do
        $TTFM --add xttfm $FONTDIR/$f
    done
    for f in $DEFAULTMING; do
        $TTFM --setdefault xttfm $FONTDIR/$f
    done
    for f in $DEFAULTKAI; do
        $TTFM --setdefault_kai xttfm $FONTDIR/$f
    done
    echo "xttfm" >> $FONTDIR/$PKGNAME
fi

exit 0