home *** CD-ROM | disk | FTP | other *** search
/ Peanuts NeXT Software Archives / Peanuts-Update.iso / CDROM / Contents / READMEs / Peanuts-2 / Text / tex / programs / MetafontOnlinePreviewer.README < prev    next >
Encoding:
Text File  |  1996-11-09  |  3.2 KB  |  68 lines

  1. I remain to be surprised that there has not been a Metafont
  2. online display for the NeXT.  Is this because there is no interest?
  3. Or perhaps this may be due to the difficulty of fitting a large
  4. existing C program (with its own event loop) into the structure
  5. of a NeXT application and its event loop.
  6.  
  7. Metafont poses a good example of porting a large C program to the
  8. NeXT and providing a graphics head to it.  What we need is a way
  9. to maintain the basic structure of Metafont and (hopefully) be able
  10. to use the most recent Metafont release; this requires minimal tampering
  11. with the basic event loop in the Metafont code.
  12.  
  13. The "usual" way of porting an application to NeXTStep
  14. seems to be to create an NeXT frontend with IB or equivalent,
  15. then invoke the underlying application through some interprocess
  16. communication.  The approach used here is the opposite.  Tis port of
  17. Metafont uses the utility program DrawingServant for doing the
  18. port from the opposite direction.  The intended use of DrawingServant
  19. is as a graphics head to an existing terminal-based program.  The
  20. Metafont program may be invoked from the terminal line;
  21. Metafont forks a process and establishes pipes to DrawingServant,
  22. then send raw postscript though a pipe to the server.
  23. The server has a small vocabulary of commands, but for the most
  24. part just copies everything not in its vocabulary with a DPSPrintf
  25. to the window manager.  The server has a simple NeXT interface
  26. that allows for saving, printing and clearing the window.
  27.  
  28. Writing the Metafont previewer was extremely simple as soon as
  29. DrawingServant was available. The code is very compact, but still
  30. has moderate capability for printing and saving.
  31.  
  32. This code was tested with web and web2c versions 5.851c and NeXTStep 3.0
  33. on black hardware.  The changes in the most recent distribution
  34. of web2c should be unimportant.
  35.  
  36. I am assuming whoever is doing this has a moderate familiarity with
  37. Metafont, building web and web2c.  The (more or less) complete
  38. instructions for installation are:
  39.     1.) Get DrawingServant from the ftp site
  40.     2.) Get web and web2c.  Follow the instructions for installation
  41.         I was using the switches -Dalloca and -ansi.
  42.         In lib/site.h (or wherever the window def's are) add
  43.         #define NEXTWIN
  44.     3.) Modify the file ../lib/texmf.c  There is a block of code that
  45.         refers to the previewers.  This needs an entry for next
  46.         The modified version is included in this distribution.
  47.     4.) move next.c to ../mf/MFwindow  add next.o to the list of
  48.         OBJ's in makefile
  49.     5.) setenv MFTERM next
  50.     6.) create a new base file, run virmf from the terminal shell.
  51.         The sequence at the ** prompt:
  52.         \relax
  53.         drawdot(200,200);showit;
  54.         will give you a cute dot.  You can print it by clicking on
  55.         the DrawingServant window then selecting print.  Or save.
  56.             The resulting dot is suitable for framing.
  57.         You must click on the terminal window to make it active
  58.         before typing.  Typing "end" will return to the terminal
  59.         shell and kill DrawingServant.
  60.     7.) A more serious test is to type logo10 or cmr10 at the **
  61.         prompt.
  62.  
  63. Comments and suggestions are welcome.
  64.     joe@ril3.tamri.com
  65.  
  66. 29 June 1993:  This version is slightly different from the version
  67. of yesterday.  The server program is killed in a cleaner way.
  68.