home *** CD-ROM | disk | FTP | other *** search
/ Fresh Fonts 1 / freshfonts1.bin / bbs / programs / amiga / metafont.lha / MF / REXX / MakeTeXFontSet.rexx < prev    next >
OS/2 REXX Batch file  |  1993-10-31  |  13KB  |  439 lines

  1. /* MakeTeXFontSet.rexx  */
  2.  
  3.    Version = '1.0'
  4.    Author  = ' Ulrich Wisser';
  5.  
  6. /*
  7.    Date   : 13-Jul-92
  8.  
  9.    Please send new features and bugreports to
  10.  
  11.    Author : Ulrich Wisser
  12.             Heerstr. 125
  13.             53111 Bonn
  14.             Germany
  15.  
  16.    WARNING!!!
  17.  
  18.    This script will call METAFONT 7 times per font and driver and
  19.    another 22 times per font for ShowDVI.
  20.    Assuming that METAFONT will only need 30 minutes per call one font
  21.    will take 3.5 hours to create for one driver and 11 hours for
  22.    ShowDVI.
  23.  
  24.                                THIS MEANS:
  25.            TO CREATE ONE FONT FOR ONE PRINTER AND ShowDVI WILL TAKE
  26.                AT LEAST 14.5 HOURS (FOR SURE IT WILL BE MORE!)
  27.  
  28.  
  29.  
  30.                    USE THIS SCRIPT ONLY WHEN NECESSARY!
  31.  
  32.   NEVER SET CALLMF TO MakeTeXFontSet.rexx because it does't understand how to
  33.   create single fonts (nor does it understand the parameters).
  34.  
  35.                              !!!!!!!!!!!!!!!!!!!
  36.  
  37.  
  38.    HOW THIS ALL WORKS!
  39.  
  40.    First install MakeBatch.rexx and MakeTeXFont.rexx as described in their
  41.    installation guide. When you "familiar" with these scripts and you really
  42.    want to create a full fontset call MakeTexFontSet.rexx. It is easy to
  43.    use. The only optional argument are a list of fonts to create.
  44.    You will be asked everything by the script. The fonts for ShowDVI are
  45.    handeled seperatly (see SHOWDVI section).
  46.  
  47.  
  48.    SIZES
  49.  
  50.    For all modes (resolutions) the following magsteps are created:
  51.       magstep 0
  52.       magstep 0.5
  53.       magstep 1
  54.       magstep 2
  55.       magstep 3
  56.       magstep 4
  57.       magstep 5
  58.  
  59.    These are the "normal" sizes which are defined by TeX's \magstep command.
  60.    The resolutions should be found in any correct installed TeX enviroment.
  61.  
  62.  
  63.     SHOWDVI
  64.  
  65.         The following table shows the DPI sizes of the magsteps:
  66.  
  67.                  |        ShowDVI Resolution        |
  68.          magstep |   44 |   83 |   91 |  100 |  120 |
  69.         ---------------------------------------------
  70.            0     |   44 |   83 |   91 |  100 |  120 |
  71.            0.5   |   48 |   91 |  100 |  110 |  131 |
  72.            1     |   53 |  100 |  109 |  120 |  144 |
  73.            2     |   63 |  120 |  131 |  144 |  173 |
  74.            3     |   76 |  143 |  157 |  173 |  207 |
  75.            4     |   91 |  172 |  189 |  207 |  249 |
  76.            5     |  109 |  207 |  226 |  249 |  299 |
  77.  
  78.          Some entries have the same DPI size so they will not be
  79.          calculated twice.
  80.  
  81.          The following table shows which DPI sizes will be really
  82.          created:
  83.  
  84.                  |        ShowDVI Resolution        |
  85.          magstep |   44 |   83 |   91 |  100 |  120 |
  86.         ---------------------------------------------
  87.            0     |   44 |   83 |   91 |  100 |  120 |
  88.            0.5   |   48 |      |      |  110 |  131 |
  89.            1     |   53 |      |  109 |      |  144 |
  90.            2     |   63 |      |      |      |  173 |
  91.            3     |   76 |  143 |  157 |      |  207 |
  92.            4     |      |  172 |  189 |      |  249 |
  93.            5     |      |      |  226 |      |  299 |
  94.  
  95.  
  96.  
  97.    USER CONFIGURATION
  98.  
  99.    This configuration should statisfy your "normal" needs. If you
  100.    need any other magsteps (or magnification) follow this instruction.
  101.  
  102.    If you have any other modes for it just append another array entry.
  103.    If you want additional magsteps you must change the array magmult.
  104.    ATTENTION this will need changes to array SDVI.
  105.    This additionell magsteps will be generated for all other modes as well.
  106.  
  107.    magmult holds all magstep information:
  108.  
  109.    magmult.0        number of entries in array magmult
  110.    magmult.i.str    holds the magstep
  111.    magmult.i.num    the relating number 1.2^(magmult.i.str)
  112.  
  113.    SDVI             holds all information relating to ShowDVI
  114.    SDVI.pkdir       dir to copy pk to (needs trailing '/')
  115.    SDVI.ModesAnz    number of modes for ShowDVI
  116.    SDVI.i           holds all information relating to one mode
  117.    SDVI.i.name      name of the mode (used by METAFONT)
  118.    SDVI.i.xdpi      horizontal resolution
  119.    SDVI.i.ydpi      vertical resolution
  120.    SDVI.i.Mag       holds all information relating to magsteps for i-th mode
  121.    SDVI.i.Mag.Anz   number of magsteps to create
  122.    SDVI.i.Mag.j     index to magmult (e.g. SDVI.i.Mag.j = 1 means magstep 0)
  123.  
  124. */
  125.  
  126. NUMERIC DIGITS 12       /* Needed to calculte correct DPI number */
  127.  
  128. magmult.0      = 7     /* number of saved magsteps */
  129. magmult.num.1  = 1.0
  130. magmult.str.1  = "0"
  131. magmult.num.2  = 1.09544511501
  132. magmult.str.2  = "0.5"
  133. magmult.num.3  = 1.2
  134. magmult.str.3  = "1"
  135. magmult.num.4  = 1.44
  136. magmult.str.4  = "2"
  137. magmult.num.5  = 1.728
  138. magmult.str.5  = "3"
  139. magmult.num.6  = 2.0736
  140. magmult.str.6  = "4"
  141. magmult.num.7  = 2.48832
  142. magmult.str.7  = "5"
  143.  
  144. SDVI.pkdir     = 'MF:SDVI/';
  145. SDVI.ModeAnz   =   5;
  146.  
  147. SDVI.1.name    = 'FourFour';
  148. SDVI.1.xdpi    =  44;
  149. SDVI.1.ydpi    =  44;
  150. SDVI.1.Mag.Anz =   5;
  151. SDVI.1.Mag.1   =   1; /* index to magmult */
  152. SDVI.1.Mag.2   =   2;
  153. SDVI.1.Mag.3   =   3;
  154. SDVI.1.Mag.4   =   4;
  155. SDVI.1.Mag.5   =   5;
  156.  
  157. SDVI.2.name    = 'EightThree';
  158. SDVI.2.xdpi    =  83;
  159. SDVI.2.ydpi    =  83;
  160. SDVI.2.Mag.Anz =   3;
  161. SDVI.2.Mag.1   =   1;
  162. SDVI.2.Mag.2   =   5;
  163. SDVI.2.Mag.3   =   6;
  164.  
  165.  
  166. SDVI.3.name    = 'NineOne';
  167. SDVI.3.xdpi    =  91;
  168. SDVI.3.ydpi    =  91;
  169. SDVI.3.Mag.Anz =   5;
  170. SDVI.3.Mag.1   =   1;
  171. SDVI.3.Mag.2   =   3;
  172. SDVI.3.Mag.3   =   5;
  173. SDVI.3.Mag.4   =   6;
  174. SDVI.3.Mag.5   =   7;
  175.  
  176. SDVI.4.name    = 'OneZeroZero';
  177. SDVI.4.xdpi    = 100;
  178. SDVI.4.ydpi    = 100;
  179. SDVI.4.Mag.Anz =   2;
  180. SDVI.4.Mag.1   =   1;
  181. SDVI.4.Mag.2   =   2;
  182.  
  183. SDVI.5.name    = 'OneTwoZero';
  184. SDVI.5.xdpi    = 120;
  185. SDVI.5.ydpi    = 120;
  186. SDVI.5.Mag.Anz =   7;
  187. SDVI.5.Mag.1   =   1;
  188. SDVI.5.Mag.2   =   2;
  189. SDVI.5.Mag.3   =   3;
  190. SDVI.5.Mag.4   =   4;
  191. SDVI.5.Mag.5   =   5;
  192. SDVI.5.Mag.6   =   6;
  193. SDVI.5.Mag.7   =   7;
  194.  
  195. /* TRACE RESULTS */
  196.  
  197. SIGNAL ON BREAK_C;
  198. SIGNAL ON BREAK_D;
  199.  
  200. modefilename = "mf:config/modes"
  201. batchname    = "mf:MakeTeXFont.sh";
  202.  
  203. SAY;
  204. SAY "MakeTeXFont.rexx Version "Version" by "Author".";
  205. SAY;
  206.  
  207. IF ~exists(batchname) THEN DO
  208.   IF ~OPEN(batchfile,batchname,'W') THEN DO
  209.     SAY "MakeBatch: Could not create "batchname" !";
  210.     EXIT 10
  211.   END
  212.   ELSE DO
  213.     CALL WRITELN(batchfile,";# Batchfile for font generation");
  214.     IF CLOSE(batchfile) THEN DO
  215.       'protect 'batchname' ADD s';
  216.       SAY "MakeBatch: Batchfile "batchname" created.";
  217.     END
  218.     ELSE DO
  219.       SAY "MakeBatch: Error during creation of "batchname" !";
  220.       EXIT 10;
  221.     END
  222.   END
  223. END
  224.  
  225. MakeFontScript = 'MF:rexx/MakeTeXFont.rexx';
  226. OPTIONS PROMPT 'Should I call 'MakeFontScript' (Y/n) ? ';
  227. DO UNTIL yn='Y'|yn='N'
  228.   PARSE UPPER PULL yn;
  229.   IF yn = '' THEN yn = 'Y';
  230. END;
  231. IF yn = "N" THEN DO
  232.   OPTIONS PROMPT "Please enter scriptname to use or RETURN to cancel:";
  233.   PARSE PULL MakeFontScript;
  234. END;
  235. DROP yn;
  236. IF MakeFontScript = '' THEN DO
  237.   SAY "Sorry, no script for fontcreation.";
  238.   EXIT;
  239. END;
  240. IF UPPER(RIGHT(MakeFontScript, 5)) = '.REXX' THEN
  241.   MakeFontScript = LEFT(MakeFontScript, Length(MakeFontScript)-5);
  242.  
  243. PARSE ARG Fontline
  244. Fonts.Anz = WORDS(Fontline)
  245. DO i=1 TO Fonts.Anz
  246.   Fonts.i = WORD(Fontline, i);
  247. END; /* DO i */
  248. IF Fonts.Anz = 0 THEN DO
  249.   SAY "You didn't supply a fontname as argument!";
  250.   SAY
  251.   OPTIONS PROMPT 'DO you want to enter fontnames (Y/n) ? '
  252.   DO UNTIL yn='Y'|yn='N'
  253.     PARSE UPPER PULL yn;
  254.     IF yn='' THEN yn = 'Y';
  255.   END;
  256. END /* IF Fonts.Anz = 0 */
  257. ELSE DO
  258.   SAY "I found the following fonts to create: ";
  259.   DO i = 1 TO Fonts.Anz
  260.     SAY '                          'Fonts.i;
  261.   END;
  262.   SAY
  263.   OPTIONS PROMPT 'DO you want to enter some more fontnames (y/N) ? '
  264.   DO UNTIL yn='Y'|yn='N'
  265.     PARSE UPPER PULL yn;
  266.     IF yn='' THEN yn = 'N';
  267.   END;
  268. END; /* ELSE */
  269.  
  270. IF yn = 'Y' THEN DO
  271.   SAY 'ENTER for no more fonts!';
  272.   inp = 'BlaBla';
  273.   DO UNTIL inp = ''
  274.     OPTIONS PROMPT 'Please enter 'Fonts.Anz+1'. font : ';
  275.     PARSE PULL inp;
  276.     IF inp ~= '' THEN DO
  277.       Fonts.Anz = Fonts.Anz + 1;
  278.       i         = Fonts.Anz;
  279.       Fonts.i   = inp;
  280.     END;
  281.   END;
  282. END; /* IF yn */
  283.  
  284. IF Fonts.Anz = 0 THEN DO
  285.   SAY 'Sorry, no FONTS ==> NOTHING TO DO';
  286.   EXIT;
  287. END;
  288.  
  289. DO i=1 TO Fonts.Anz
  290.   IF UPPER(RIGHT(Fonts.i, 3)) = '.MF' THEN
  291.     Fonts.i = LEFT(Fonts.i, LENGTH(Fonts.i)-3);
  292. END;
  293.  
  294. DPISTR = '';
  295. DO i=1 TO SDVI.ModeAnz
  296.   DPISTR=  DPISTR' 'SDVI.i.xdp