Subversion Repositories wimsdev

Rev

Rev 7033 | 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.
8179 bpr 37
underscore="_"
10 reyssat 38
 
39
leftpar1='('
40
rightpar1=')'
41
leftbrace1='\{'
42
rightbrace1='\}'
43
Lleftpar='\left(';  Rleftpar='\right.'
44
Lrightpar='\left.'; Rrightpar='\right)'
45
Lleftbrace='\left\{'; Rleftbrace='\right.'
46
Lrightbrace='\left.'; Rrightbrace='\right\}'
5203 bpr 47
add='\\ '
10 reyssat 48
in=$add$add
49
for size in 2 3; do
50
  for type in leftpar leftbrace rightpar rightbrace; do
51
    eval L='$'L$type; eval R='$'R$type;
5203 bpr 52
    eval $type$size=\'$L\\begin\{array\}\{c\}$in\\end\{array\}$R\'
10 reyssat 53
  done
54
  in=$in$add
55
done
56
# discontinuity !
57
in=$in$add
58
for size in 4 5 6 7 8 9 10; do
59
  for type in leftpar leftbrace rightpar rightbrace; do
60
    eval L='$'L$type; eval R='$'R$type;
5203 bpr 61
    eval $type$size=\'$L\\begin\{array\}\{c\}$in\\end\{array\}$R\'
10 reyssat 62
  done
63
  in=$in$add
64
done
65
 
66
# for density in 100
67
for density in 63 69 76 83 91 100 109 120 131 144 158 173
68
do
69
  texgif_density=$density
70
  mkdir -p $FONT_DIR/$density
8179 bpr 71
 
10 reyssat 72
  for f in `cat $SRC_DIR/mathfonts`
73
  do
74
    if (echo $f | grep '[A-Z]')>/dev/null; then F=$f$underscore; else F=$f; fi
75
    texgif_outfile=$FONT_DIR/$density/$F.gif
76
    if [ ! -s $texgif_outfile ]; then
77
      echo $density/$f
78
      texgif_src="\$ \\$f \$"
79
      $tex2gif >>$texgifout
80
    fi
81
  done
8179 bpr 82
 
10 reyssat 83
  for f in x y z
84
  do
85
    texgif_outfile=$FONT_DIR/$density/$f.gif
86
    if [ ! -s $texgif_outfile ]; then
87
      echo $density/$f
88
      texgif_src="\$ $f \$"
89
      $tex2gif >>$texgifout
90
    fi
91
  done
8179 bpr 92
 
10 reyssat 93
  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
94
  do
8179 bpr 95
#upper case
10 reyssat 96
    F=$f$underscore
97
    texgif_outfile=$FONT_DIR/$density/$f$F.gif
98
    if [ ! -s $texgif_outfile ]; then
99
      echo $density/$f$f
100
      texgif_src="\$ \\mathbb $f \$"
101
      $tex2gif >>$texgifout
102
    fi
103
    texgif_outfile=$FONT_DIR/$density/euf$F.gif
104
    if [ ! -s $texgif_outfile ]; then
105
      echo $density/euf$f
5462 bpr 106
      texgif_src="\$ \\mathfrak{$f} \$"
10 reyssat 107
      $tex2gif >>$texgifout
108
    fi
109
    texgif_outfile=$FONT_DIR/$density/cal$F.gif
110
    if [ ! -s $texgif_outfile ]; then
111
      echo $density/cal$f
5203 bpr 112
      texgif_src="\$ \\mathcal{$f} \$"
10 reyssat 113
      $tex2gif >>$texgifout
114
    fi
8179 bpr 115
#lower case
7033 bpr 116
    f=`echo $f | tr [:upper:] [:lower:]`
10 reyssat 117
    texgif_outfile=$FONT_DIR/$density/euf$f.gif
118
    if [ ! -s $texgif_outfile ]; then
119
      echo $density/euf$f
5462 bpr 120
      texgif_src="\$ \\mathfrak{$f} \$"
10 reyssat 121
      $tex2gif >>$texgifout
122
    fi
123
  done
124
# delimiters () {}
125
  for type in leftpar leftbrace rightpar rightbrace; do
126
    for size in 1 2 3 4 5 6 7 8 9 10; do
127
      f=$type$size; eval src='$'$f
128
      texgif_outfile=$FONT_DIR/$density/$f.gif
129
      if [ ! -s $texgif_outfile ]; then
130
        echo "$density/$f"
131
        texgif_src="\$\$ $src \$\$"
132
        $tex2gif >>$texgifout
133
      fi
134
    done
135
  done
8179 bpr 136
 
10 reyssat 137
  for syn in `cat $SRC_DIR/mathfonts-synonyms`
138
  do
139
     j1=`echo $syn | awk -F, '{print $1}'`
140
     j2=`echo $syn | awk -F, '{print $2}'`
141
     f=$FONT_DIR/$density/$j1.gif
142
     if [ ! -r $f ]; then ln -s $j2.gif $f; fi
143
  done
144
done
145
 
5462 bpr 146
rm -f $HOME_DIR/tmp/texgif.*