| 1 |
#!/bin/bash |
| 2 |
# enctofontpos GlyphListFile Alphabet |
| 3 |
# encoding vector is on standard input |
| 4 |
|
| 5 |
GlyphListFile=$1 |
| 6 |
Alphabet=$2 |
| 7 |
|
| 8 |
echo "% Symbol declarations for Glyph List $GlyphListFile, generated `date`." |
| 9 |
|
| 10 |
read LineIn1 LineInRest |
| 11 |
ErrorVal=$? |
| 12 |
|
| 13 |
Num=0 |
| 14 |
|
| 15 |
while [ $ErrorVal -eq 0 ] |
| 16 |
do |
| 17 |
if [ "$LineIn1" != "" ] |
| 18 |
then |
| 19 |
Char=`echo $LineIn1 | cut -d/ -f 2` |
| 20 |
LineIn2=`grep glyph\{$Char\} $GlyphListFile` |
| 21 |
# put glyph{} around $Char so that alpha does not match with \mathalpha, and for renamed glyphs like diamond |
| 22 |
MacroName=`echo $LineIn2 | cut -d{ -f 4 | cut -d} -f 1` |
| 23 |
CharType=`echo $LineIn2 | cut -d{ -f 5 | cut -d} -f 1` |
| 24 |
#echo "% $Char $MacroName $CharType" |
| 25 |
if [ "$MacroName" != "\\nomacro" ] |
| 26 |
then |
| 27 |
echo "\\DeclareMathSymbol{\\$MacroName}{\\$CharType}{$Alphabet}{$Num} % $Char" |
| 28 |
fi |
| 29 |
Num=$(($Num+1)) |
| 30 |
fi |
| 31 |
read LineIn1 LineInRest |
| 32 |
ErrorVal=$? |
| 33 |
done |