		     How to make .mgp files (cheat sheet)

		      Kazu Yamamoto (with Chaki)

			  December 25, 1997


All .mgp commands start with "%". After making sure that
/usr/X11R6/lib/X11/mgp/default.mgp exists, add the following line to
the beginning of the .mgp file.

	%include default.mgp

This determines the default style. Each page begins with "%page".

	%page

	TITLE

	Body

MagicPoint is line oriented. Don't write anything in the first line
because the default style uses the first line for making space at the
top of the screen. The second line is the title of the page. The third
line is transformed into a horizontal line. The fourth line on becomes
the body.

When there is a "%" at the beginning of a line, the rest of the line
becomes a command. Multiple commands separated by "," can be written
in a single line. To make the size 7% of the screen and the foreground
color yellow, one would write:

	%size 7, fore yellow
	This line is big and yellow.

Any line that starts with "%" won't show up on the screen nor will it
be counted as a line. The following parameters can be used to change
how a line looks.

	text color			%fore
	background color		%back
	text size			%size
	text placement			%center, %left, %right
	space between characters	%hgap
	space between lines		%vgap
	VFLib Font			%vfont
	X11 Font			%xfont

There are a few others, but this should be enough for now. The
parameters of default.mgp are set as follows:

	%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
	%default 1 leftfill, size 2, fore "white", back "black", vfont goth, xfont times-medium-i
	%default 2 size 7, vgap 20, prefix " "
	%default 3 size 2, bar gray70, vgap 10
	%default 4 size 5, fore "white", vgap 30, prefix " "

%default set the parameters for the line specified in the first
argment to the values specified the second and later argments. In the
first line, the size is 2% and in the second line the size is set to
7%. Parameters set in previous lines are valid unless
overwritten. Therefore, the text in the second line will be white.

When MagicPoint shows a particular line, it first refers to the
%default values. Then it refers to the values set within the
body. Values of the previous line remain valid unless set otherwise.

Let's take a look at the following example:

	%page
						(A space of 2%)
	TITLE --- size 7% color white and in gothic font
						(horizontal line)
	text --- size 5% white gothic font
	%fore yellow, size 4
	text --- size 4% yellow gothic font 
	%vfont min
	text --- size 4% yellow mincho font 

%tab is a command that directly associates with the line. In
default.mgp it is set as follows:

	%tab 1 size 5, vgap 40, prefix "  ", icon box green 50
	%tab 2 size 4, vgap 40, prefix "      ", icon arc yellow 50
	%tab 3 size 3, vgap 40, prefix "            ", icon arc white 40

When there is a singular tab at the head of the line, the values of
%tab override the current values and become valid. When there are two
tabs at the head of the line, %tab2 becomes valid, when there are
three tabs at the head of the line %tab3 becomes valid and so on.

In other words,
1 tab means text size 5% and the line starts with spaces and green box icon.
2 tabs mean text size 4% and the line starts with spaces and yellow arc icon. 
3 tabs mean text size 3% and the line starts with spaces and white arc icon.

By using this, it's easy to itemize. Let's take a look at an example:

	%page

	Emacs and friends

		Emacs
			19 is currently the main stream
			20 has been released
		Mule
			2.3 is most used
			Integrated to Emacs and XEmacs 
		XEmacs
			19 is the English version
			20 is the International version

To find out more about the other commands, take a look at SYNTAX or
sample/*.mgp.

			    Life with tgif


MagicPoint cannot display tgif objs but there is a way to sort of get
around this.

	- make tgif create a GIF file for screen display
	- make tgif create an EPS file for printing out

The image created by tgif is displayed "as is" on MagicPoint's screen.
This is pretty sad when fonts aren't displayed clearly when viewing
with tgif. Either Mincho or Gothic font is provided for 14, 16, 24,
and 26 dot. So it's possible to give xrdb something like the
following, and then make tgif create a GIF file.

Tgif*Background: black
Tgif*Foreground: white
Tgif*WhereToPrint: EPS
Tgif*InitialFontSize: 16
Tgif*InitialKanjiFont: Gothic
Tgif*FontSizes: 14 16 24 26
Tgif*NihongoFonts: \
	-*-fixed-medium-r-normal--%d-*-*-*-*-*-jisx0208.1983-0,, \
	Ryumin-Light-EUC-H, Ryumin, \
	H, false, 24, 26 \n\
	-*-fixed-medium-r-normal--%d-*-*-*-*-*-jisx0208.1983-0,, \
	GothicBBB-Medium-EUC-H, Gothic, \
	H, false, 16, 18 \n\
	-*-fixed-medium-r-normal--%d-*-*-*-*-*-jisx0208.1983-0,, \
	Ryumin-Light-EUC-V, Ryumin-V, \
	V, false, 24, 26 \n\
	-*-fixed-medium-r-normal--%d-*-*-*-*-*-jisx0208.1983-0,, \
	GothicBBB-Medium-EUC-V, Gothic-V, \
	V, false, 16, 18

EPS files can be created just by typing:
	tgif -print -eps *.obj
This is convenient when you have a whole lot of files.

However, some files might not get the right colors using this way. If
you find any files that don't have the right colors, try manually
creating the EPS file using tgif.

If corresponding filename.eps exists for filename.{gif,jpg,...}, mgp2ps
uses filename.eps when creating a PS file.

If you want to bundle two pages into one, you could try this:
	pstops '2:0R@.5(2cm,26cm)+1R@.5(2cm,13cm)' input.ps > output.ps
