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