summaryrefslogtreecommitdiff
path: root/language/chinese/CJK/cjk-4.8.5/utils/hbf2gf/scripts/web2c-7.0/MakeTeXPK.diff
blob: 23f7cb58fed335f2cf5f741a5b707f4a86a670da (plain)
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
--- MakeTeXPK.orig	Sat Feb  8 15:52:00 1997
+++ MakeTeXPK	Tue Aug 18 07:58:22 1998
@@ -1,5 +1,5 @@
 #!/bin/sh
-# original MakeTeXPK -- make a new PK font, because one wasn't found.
+# MakeTeXPK -- make a new PK font, because one wasn't found.
 # 
 # (If you change or delete the word `original' on the previous line,
 # installation won't write this script over yours.)
@@ -44,15 +44,54 @@
 MODE=$5
 DEST=$6
 
+unset cmd
+
+# test for TTF fonts
+if test -z "$cmd"; then
+  ttf2pk -q $NAME $DPI
+  errstatus=$?
+
+  if test $errstatus -ne 2; then
+    if test $errstatus -ne 0; then
+      echo "ttf2pk failed" >&2
+      exit 1
+    fi
+    MODE=modeless
+    cmd=true
+  fi
+fi
+
+# test for HBF fonts
+if test -z "$cmd"; then
+  hbf2gf -q -p $NAME $DPI
+  errstatus=$?
+
+  if test $errstatus -ne 2; then
+    if test $errstatus -ne 0; then
+      echo "hbf2gf failed" >&2
+      exit 1
+    fi
+    MODE=modeless
+    cmd=true
+  fi
+fi
+
+unset psline
+
 # grep for the font in $PSMAPFILE.  These are base font names, such as
 # rpplr (the original) or pplr0 (an interim step) or pplr8r (current).
-pattern="^r?$NAME"'(0|8r)?([ 	]|$)' 
-psline=`egrep "$pattern" $PSMAPFILE`
+if test -z "$cmd"; then
+  pattern="^r?$NAME"'(0|8r)?([ 	]|$)' 
+  psline=`egrep "$pattern" $PSMAPFILE`
+fi
+
 if test -n "$psline"; then
   MODE=modeless
   # ps_to_pk set in MakeTeXcommon and/or MakeTeX.site.
   cmd="$ps_to_pk $NAME $DPI" 
-else
+fi
+
+if test -z "$cmd"; then
   # Check that $BDPI and $MODE are consistent; if not, ignore the mode and
   # hope we can correctly guess it from bdpi.  (People like to specify the
   # resolution on the command line, not the mode so much.)