[comp.sys.atari.st] TeX, Metafont etc.

DERMOTT@XX.DREA.DND.CA (Dave Dermott) (01/20/89)

RE: ST TeX, Metafont etc.
  I have recently recompiled Tex-C 2.9 with GNU-C. The resulting
executable files are about 10% smaller than the Megamax version and
runs slightly faster. Running GNU-C on a 1 meg machine is not easy.
When I tried to compile some of the TeX files with the OPTIMIZE
switch GNU-C ran out of memory. So it is possible to optimize TeX
even more with more memory.
   I made a few refinements:
 By fine-tuning the fopen-fgetc-fread functions in the C library I cut
down the time to load LPLAIN.FMT from 20 to 10 seconds (no big deal
when a typical Latex document takes several minutes)
  I allowed memmax , the size of the biggest array in TeX, to be adjusted
at run time by setting an environment variable. There is now about 290K
free when it is set to minimum value which should be enough for GULAM etc.
   I added another environment variable to be set if GULAM is being used.
This allows use of "," instead of ";" in directory search paths.

    I call Malloc() for the large arrays and them Free() them at end. This
was the easiest way to make room to Pexec() an editor (Microemacs). Is there
a fail-safe way to cause Pexec() to overlay instead 
of loading at top of calling program? This would be "chaining".


   I will try to repost this version to the him1 archives (pc7: at
[35.1.1.43] but I have a lot of trouble connecting to there.

    I have the newest WEB-To-C system on a UNIX system and have ported
METAFONT-C on it. It should be  fairly easy to port METAFONT to the ST
using GNU-C on a MEGA-ST. A reliable source says it has already been done.
I believe METAFONT uses a lot more floating point routines (maybe trig
functions too) so one needs a good FP library.
BIBTEX can also be ported via WEB-to-C.

   The fonts used by the PC-VGA previewer DVIVGA can also be used by
DVIST if the directory tree is set up appropriately. The default
resolution is 92 DPI rather than 96 so one has so type DVIST -v=92
etc. The DVIVGA distribution I got by FTP from [128.174.90.2]
contained about 1 meg of PK fonts in many sizes.

   I put a few mods in DVIST. I have been unable to contact the
authors at YORK univ. The first allows dumping the current page
on a EPSON compatible printer ( at low res) by typing the
* or C keys . The second tries to load a default font if
a requested font is missing.

here are the source changes:
----------------------------------------------------------------------
changes in atari.h for print page (old,new)
* or C does hard copy, ALT-HELP aborts
327,327c327,327
 #define K_GOTOSECTION   'S':case 's'         /* Goto to sectioned page x.x.x */
|#define K_PRINT         KSTAR                /* Print a page */
 
---
 #define K_GOTOSECTION   'S':case 's'         /* Goto to sectioned page x.x.x */
|#define K_PRINT         KSTAR:case '*':case 'c':case 'C'   /* Print a page */
 
343,343c343,343
 #define UNDO        0x161
|#define KSTAR       0x166
 
---
 #define UNDO        0x161
|#define KSTAR       0x166  /* this is wrong ! */
 
368,368c368,368
 		case K_HELP:	        return HELP;
|		case K_PRINT:           return ERROR;
 		default:	        return ERROR;
---
 		case K_HELP:	        return HELP;
|		case K_PRINT:           return PRINT;
 		default:	        return ERROR;
494a495,498
 				return;
|			case PRINT:
|				hardcopy();
|				fprintf(stderr,"\007"); fflush(stderr);
|				break;
 
542,542c546,600
 
|
---
 
|/* hard copy to epson B&W dot matrix */
|struct param {
|unsigned char *blkprt; /* address of bit map */
|int offset; /* ??? */
|int width; /* width in pixels */
|int height; /* height in pixels */
|int left; /* ??? */
|int right; /* ??? */
|int scrres; /*screen res */
|int dstres; /* printer res*/
|int *colpal; /* pointer to color pallet */
|int type; /* printer type */
|int port; /* serial or centronix */
|int *masks; /* halftone mask ? */
|};
|
|struct param par;
|int colors[16];
|hardcopy()
|{
|int *hdcpy;
|long ssave;
|hdcpy = (int *)0x4ee; /* address of harcopy flag */
|
|colors[0]=0x777; /* white*/
|colors[1]=0;  /* black */
|
|par.blkprt = (unsigned char *)pagebuffer;
|par.offset =0;
|par.width = 640;
|par.height = y_pixel;
|
|par.left =0;
|par.right =0;
|par.scrres =2; /* hi res */
|par.dstres =0; 
| par.colpal= colors;
|par.type =3; /* epson BW */
|par.port =0; /* centronix port */
|
|par.masks =(int *)0l; /* no masks */
|ssave=Super(0L);
|*hdcpy=1; /* must set hardcopy flag =1 */
|Super(ssave);
|xbios(36,&par); /* prtdump */
|ssave=Super(0L);
|*hdcpy= -1;
|Super(ssave);
|
|}
|
-----------------
   Here is a suggested change to DVIST(3.2). It is inconvenient
to have the program abort when a font is missing. Quite often
only a few characters in the missing font are needed. So I added
a search for a default font (CMR10 at standard size) . I also
print out the real name of the requested font not found rather
than the last approximation (+- 10 pt).

Thanks again for DVIST
David Dermott
DREA
Dartmouth NS
--------------------------------------------------------------
   Changes in DVIDRV.C {getfontpath() } to try a default font if
requested font not found. Also print original name requested rather
than last approximation.

800a801,801
 	char fontname[MAXPATHLEN],pxlname[MAXPATHLEN*2], *fullname;
|	char realname[MAXPATHLEN*2]; /* original name */
 	FILE *fontfile = (FILE *)0;
855a857,857
 		{
|			strcpy(realname,pxlname);/* save original name D.D. */
 			if( showfonts ) break;	/* just report usage */
867,868c869,880
 			save_err = errno;
|			fprintf(stderr,"Unable to open\n %s\n",pxlname);
|			bad_exit(save_err);
 		}
---
 			save_err = errno;
|/*			fprintf(stderr,"Unable to open\n %s\n",pxlname);*/
|/* print original name , hacked by David Dermott */
|			fprintf(stderr,"Unable to open\n %s\n",realname);
|/* try a default font */
|#ifdef BY_NAME /* stored by name */
|		sprintf(pxlname,"%s%c%ldpk","cmr10",SLASH,hdpi);
|#else /* stored by size */
|		sprintf(pxlname,"font%04ld%c%s.pk",hdpi,SLASH,"cmr10");
|#endif /* stored by size */
|   fprintf(stderr,"trying default %s \n",pxlname);
|		fontfile = pathfopen((dirlength ? NONAME:fontpath),pxlname,"r");
|		if(fontfile == NOFILE)bad_exit(save_err);
 		}


-------------------------------
Acknowlegements to:
Donald Knuth for TeX
Tim Morgan for WEB-to-C
John Dunning for GNU-C
Tyler Ivanco and Avy Moise for DVIST

David Dermott DERMOTT@xx.drea.dnd.ca
-------

dennis@marge.math.binghamton.edu (dennis pixton) (01/21/89)

Is there an ST DVI previewer which will run on a color monitor??

Dennis Pixton				
Department of Mathematical Sciences	(607) 777-4239
SUNY-Binghamton				dennis@marge.math.binghamton.edu
Binghamton, NY  13901			dpixton@bingvaxb.bitnet