#!/bin/sh # # Automatic generation of driver files for French Cursive. # # © Emmanuel Beffara, 2001--2004. This script is covered by the GPL licence, # and is part of the French Cursive font sources. calc() { ( echo "scale=3"; echo $* ) | bc -l } make_driver() { DESCR="" # textual description IDENT="" # font identifier SIZE=$1 # specific size in points EX=0 # value of ex# in sharp points THIN=0.2 # thickness of thin drawings MED=0.4 # thickness of medium drawings THICK=0.6 # thickness of thick drawings DOT=0.8 # diameter of dots WIDTH=0.8 # base width SLANT=0 # slant factor ACCW=0.7 # relative width of accents FIXED=false # fixed-thickness version ? shift while [ "$#" != 0 ]; do case $1 in bold) IDENT="${IDENT}B"; MED=0.55; THICK=0.8; DOT=1.25; DESCR="${DESCR}bold ";; callig) IDENT="${IDENT}C"; MED=0.3; THICK=0.8; DESCR="${DESCR}calligraphic ";; ext) IDENT="${IDENT}X"; WIDTH=0.9; DESCR="${DESCR}extended ";; slant) IDENT="${IDENT}SL"; SLANT=0.3; DESCR="${DESCR}slanted ";; fixed) IDENT="${IDENT}F"; FIXED=true; THIN=$MED; THICK=$MED; DOT=`calc "2*$MED"`; DESCR="${DESCR}fixed-thickness ";; esac shift done # The value of ex# is computed the same way as for Computer Modern: EX=`calc "$SIZE*15.5"`/36 # The base width is multiplied by a scale factor related to height WIDTH=`calc "$WIDTH/e(l($SIZE/10)/6)"` # Correct the thickness values according to the size: THIN=`calc "$THIN*$SIZE/10"` MED=`calc "$MED*$SIZE/10"` THICK=`calc "$THICK*$SIZE/10"` DOT=`calc "$DOT*$SIZE/10"` # The identifier is "FRC" followed by the letters above (or "R") IDENT="FRC${IDENT:-R}" # And here we go... cat < at " exit 1 fi local SIZE for SIZE in $SIZES; do local RS=$(echo "x=$SIZE;y=x-x%1;if(x%1>.5)y+1else y" | bc) local FN="$NAME${RS%%.*}.mf" echo "making $FN" make_driver $SIZE $OPTS > $FN done } if [ "$#" = 0 ]; then cat < at $(basename $0) default The second form produces a set of standard variants and sizes. The modifiers are words among: bold = thicker stems and hairlines callig = more contrasted stems and hairlines fixed = fixed thickness ext = slightly extended width slant = well, slanted... The sizes are expressed in points, they can be non-integer. The file names produced are of the form .mf. EOF elif [ "$1" = default ]; then make_series frcr at 7 8 9 10 10.95 12 14.4 17.28 make_series frcsl slant at 7 8 9 10 10.95 12 14.4 17.28 make_series frcbx bold ext at 7 8 9 10 10.95 12 14.4 17.28 make_series frcslbx slant bold ext at 7 8 9 10 10.95 12 14.4 17.28 make_series frcc callig at 10 10.95 12 14.4 make_series frcf fixed at 10 10.95 12 14.4 else make_series $@ fi