Subversion Repositories wimsdev

Rev

Rev 5462 | Rev 8179 | Go to most recent revision | Details | Compare with Previous | Last modification | View Log | RSS feed

Rev Author Line No. Line
10 reyssat 1
#! /bin/sh
2
#
3
# This file generates mathematical fonts via tex2gif.
4
# You must redefine the directory settings.
5
 
6
textest=`tex -v 2>/dev/null`
7
if [ -z "$textest" ]; then
8
 cat <<@
9
 
10
ERROR! TeX not found in your system.
11
WIMS will not work properly without TeX. Please check your installation.
12
 
13
@
14
 exit 1
15
fi
16
 
17
cd `dirname $0`/..
18
HOME_DIR=`pwd`
19
SRC_DIR=$HOME_DIR/src
20
HTML_DIR=$HOME_DIR/public_html
21
FONT_DIR=$HTML_DIR/mathfonts
22
FOUT_DIR=$HTML_DIR/w
23
cd $SRC_DIR
24
 
25
tex2gif=$HTML_DIR/bin/tex..gif
26
texgifout=$HOME_DIR/tmp/texgif.out
27
wims_server_base=$HTML_DIR
28
texgif_tmpdir=$HOME_DIR/tmp
29
texgif_fontdir=$FOUT_DIR/texgif
3441 bpr 30
texgif_texheader=$FONT_DIR/header.latex
10 reyssat 31
export wims_server_base texgif_tmpdir texgif_fontdir texgif_texheader
32
export texgif_src texgif_outfile texgif_density
33
rm -f $texgifout 2>/dev/null
34
 
35
# test case-sensitiveness of the file system.
36
# Note that there is a wims.c, but no WIMS.C in the directory.
37
if [ -f WIMS.C ]; then
38
  underscore="_"
39
else
40
  underscore=""
41
fi
42
 
43
leftpar1='('
44
rightpar1=')'
45
leftbrace1='\{'
46
rightbrace1='\}'
47
Lleftpar='\left(';  Rleftpar='\right.'
48
Lrightpar='\left.'; Rrightpar='\right)'
49
Lleftbrace='\left\{'; Rleftbrace='\right.'
50
Lrightbrace='\left.'; Rrightbrace='\right\}'
5203 bpr 51
add='\\ '
10 reyssat 52
in=$add$add
53
for size in 2 3; do
54
  for type in leftpar leftbrace rightpar rightbrace; do
55
    eval L='$'L$type; eval R='$'R$type;
5203 bpr 56
    eval $type$size=\'$L\\begin\{array\}\{c\}$in\\end\{array\}$R\'
10 reyssat 57
  done
58
  in=$in$add
59
done
60
# discontinuity !
61
in=$in$add
62
for size in 4 5 6 7 8 9 10; do
63
  for type in leftpar leftbrace rightpar rightbrace; do
64
    eval L='$'L$type; eval R='$'R$type;
5203 bpr 65
    eval $type$size=\'$L\\begin\{array\}\{c\}$in\\end\{array\}$R\'
10 reyssat 66
  done
67
  in=$in$add
68
done
69
 
70
# for density in 100
71
for density in 63 69 76 83 91 100 109 120 131 144 158 173
72
do
73
  texgif_density=$density
74
  mkdir -p $FONT_DIR/$density
75
 
76
  for f in `cat $SRC_DIR/mathfonts`
77
  do
78
    if (echo $f | grep '[A-Z]')>/dev/null; then F=$f$underscore; else F=$f; fi
79
    texgif_outfile=$FONT_DIR/$density/$F.gif
80
    if [ ! -s $texgif_outfile ]; then
81
      echo $density/$f
82
      texgif_src="\$ \\$f \$"
83
      $tex2gif >>$texgifout
84
    fi
85
  done
86
 
87
  for f in x y z
88
  do
89
    texgif_outfile=$FONT_DIR/$density/$f.gif
90
    if [ ! -s $texgif_outfile ]; then
91
      echo $density/$f
92
      texgif_src="\$ $f \$"
93
      $tex2gif >>$texgifout
94
    fi
95
  done
96
 
97
  for f in A B C D E F G H I J K L M N O P Q R S T U V W X Y Z
98
  do
99
#upper case 
100
    F=$f$underscore
101
    texgif_outfile=$FONT_DIR/$density/$f$F.gif
102
    if [ ! -s $texgif_outfile ]; then
103
      echo $density/$f$f
104
      texgif_src="\$ \\mathbb $f \$"
105
      $tex2gif >>$texgifout
106
    fi
107
    texgif_outfile=$FONT_DIR/$density/euf$F.gif
108
    if [ ! -s $texgif_outfile ]; then
109
      echo $density/euf$f
5462 bpr 110
      texgif_src="\$ \\mathfrak{$f} \$"
10 reyssat 111
      $tex2gif >>$texgifout
112
    fi
113
    texgif_outfile=$FONT_DIR/$density/cal$F.gif
114
    if [ ! -s $texgif_outfile ]; then
115
      echo $density/cal$f
5203 bpr 116
      texgif_src="\$ \\mathcal{$f} \$"
10 reyssat 117
      $tex2gif >>$texgifout
118
    fi
119
#lower case 
7033 bpr 120
    f=`echo $f | tr [:upper:] [:lower:]`
10 reyssat 121
    texgif_outfile=$FONT_DIR/$density/euf$f.gif
122
    if [ ! -s $texgif_outfile ]; then
123
      echo $density/euf$f
5462 bpr 124
      texgif_src="\$ \\mathfrak{$f} \$"
10 reyssat 125
      $tex2gif >>$texgifout
126
    fi
127
  done
128
# delimiters () {}
129
  for type in leftpar leftbrace rightpar rightbrace; do
130
    for size in 1 2 3 4 5 6 7 8 9 10; do
131
      f=$type$size; eval src='$'$f
132
      texgif_outfile=$FONT_DIR/$density/$f.gif
133
      if [ ! -s $texgif_outfile ]; then
134
        echo "$density/$f"
135
        texgif_src="\$\$ $src \$\$"
136
        $tex2gif >>$texgifout
137
      fi
138
    done
139
  done
140
 
141
  for syn in `cat $SRC_DIR/mathfonts-synonyms`
142
  do
143
     j1=`echo $syn | awk -F, '{print $1}'`
144
     j2=`echo $syn | awk -F, '{print $2}'`
145
     f=$FONT_DIR/$density/$j1.gif
146
     if [ ! -r $f ]; then ln -s $j2.gif $f; fi
147
  done
148
done
149
 
5462 bpr 150
rm -f $HOME_DIR/tmp/texgif.*