Index: kit/Imakefile.in
diff -u kit/Imakefile.in:1.47 kit/Imakefile.in:1.48
--- kit/Imakefile.in:1.47	Mon Apr 12 03:14:12 1999
+++ kit/Imakefile.in	Thu May 27 12:22:45 1999
@@ -1,4 +1,4 @@
-# $Id: Imakefile.in,v 1.47 1999/04/11 18:14:12 nishida Exp $
+# $Id: Imakefile.in,v 1.48 1999/05/27 03:22:45 nishida Exp $
 
 @SET_MAKE@
 srcdir=	@srcdir@
@@ -12,7 +12,7 @@
 	embed.o
 LIBOBJS=	@LIBOBJS@
 OBJS=	${TPOBJ} ${PROBJS} ${LIBOBJS}
-LIBS=	$(srcdir)/image/libimage.a
+LIBS=	$(srcdir)/image/libmgpimage.a
 AWK=	@AWK@
 PERL=	@mgp_cv_path_perl@
 YACC=	@YACC@
@@ -23,7 +23,7 @@
 DEFS=	@DEFS@ -DMGPLIBDIR=\"$(LIBDIR)/mgp\"
 #DEFS+=	-DGLYPHEDGE
 
-SYS_LIBRARIES=	-L$(srcdir)/image -limage @LIBS@
+SYS_LIBRARIES=	-L$(srcdir)/image -lmgpimage @LIBS@
 EXTRA_DEPLIBS=	@DEPLIBS@
 
 #undef DefaultCDebugFlags
@@ -74,7 +74,7 @@
 #define IHaveSubdirs
 
 SUBDIRS=	image sample contrib
-NamedMakeSubdirs($(srcdir)/image/libimage.a, image)
+NamedMakeSubdirs($(srcdir)/image/libmgpimage.a, image)
 MakeSubdirs(sample contrib)
 
 mgp.o: $(srcdir)/mgp.c ctlwords.h
Index: kit/README.fonts
diff -u kit/README.fonts:1.21 kit/README.fonts:1.22
--- kit/README.fonts:1.21	Mon May 24 00:28:59 1999
+++ kit/README.fonts	Thu May 27 12:22:46 1999
@@ -1,6 +1,6 @@
 	    Configuring fonts for MagicPoint presentation
 
-$Id: README.fonts,v 1.21 1999/05/23 15:28:59 nishida Exp $
+$Id: README.fonts,v 1.22 1999/05/27 03:22:46 nishida Exp $
 
 For better presentation with "MagicPoint" presentation tool, it is
 necessary to configure your MagicPoint, and maybe your X11 server to
@@ -72,12 +72,16 @@
 Scalable Japanese fonts, with FreeType
 ---------------------------------
 Recent MagicPoint can use FreeType library for rendering Japanese fonts.
-You can use this function to execute configure script, as below:
+You can use this function by executing configure script as below:
 
 	./configure --enable-freetype-charset16
 
+You also need to specify japanese truetype fontfile with 'tmfont' directive.
+The usage of 'tmfont' directive is described in the SYNTAX file.
+
+Note: 
 If you have already installed VFlib library and you want to use FreeType 
-library to render Japanese fonts, you have to disable vflib, as below:
+library to render Japanese fonts, you have to disable vflib as below:
 
 	./configure --disable-vflib --enable-freetype-charset16
 
Index: kit/README.fonts.jp
diff -u kit/README.fonts.jp:1.11 kit/README.fonts.jp:1.12
--- kit/README.fonts.jp:1.11	Mon May 24 00:29:01 1999
+++ kit/README.fonts.jp	Thu May 27 12:22:47 1999
@@ -1,6 +1,6 @@
 	 MagicPoint$B%W%l%<%s%F!<%7%g%sMQ$N%U%)%s%H@_Dj$K$D$$$F(B
 
-$Id: README.fonts.jp,v 1.11 1999/05/23 15:29:01 nishida Exp $
+$Id: README.fonts.jp,v 1.12 1999/05/27 03:22:47 nishida Exp $
 
 	-----$BF|K\8lHG(B(README.fonts.jp)$B$K4X$9$kCm0U(B-----
 	$B1Q8lHG(B(README.fonts)$B$NJ}$,@5<0$G$9!#(B
@@ -101,6 +101,9 @@
 	./configure --enable-freetype-charset16
 
 $B$N$h$&$K%*%W%7%g%s$r;XDj$7$F(Bconfigure$B$r<B9T$7$F$/$@$5$$!#(B
+$B$3$N@_Dj$K$h$j!"(B'tmfont'$B$H$$$&(Bdirective$B$,;HMQ$G$-$k$h$&$K$J$j$^$9!#(B
+'tmfont' directive$B$G!"F|K\8l$N(BTrueType$B%U%)%s%H$r;XDj$7$F$/$@$5$$!#(B
+tmfont directive$B$N(BSYNTAX$B$K$D$$$F$O!"(BSYNTAX$B%U%!%$%k$r;2>H$7$F$/$@$5$$!#(B
 
 (*$BCm(B) VFlib$B$,%$%s%9%H!<%k$5$l$F$$$k4D6-$G!"(BFreeType$B$rMxMQ$7$FF|K\8l%U%)%s%H(B
 $B$rI=<($7$?$$>l9g$O!"(Bconfigure $B%9%/%j%W%H$N<B9T;~$K(B
Index: kit/SYNTAX
diff -u kit/SYNTAX:1.23 kit/SYNTAX:1.24
--- kit/SYNTAX:1.23	Fri Apr 23 15:07:35 1999
+++ kit/SYNTAX	Thu May 27 12:22:49 1999
@@ -1,4 +1,4 @@
-$Id: SYNTAX,v 1.23 1999/04/23 06:07:35 itojun Exp $
+$Id: SYNTAX,v 1.24 1999/05/27 03:22:49 nishida Exp $
 
 placement restriction for directives:
 		.mgprc		preamble	main pages
@@ -119,6 +119,11 @@
 
 %tfont "font"
 	<font> :: use TrueType font <font> to draw ASCII characters.
+		<font> can be full pathname, or just filename.  Use %tfdir
+		for setting default font directory.
+
+%tmfont "font"
+	<font> :: use TrueType font <font> to draw Kanji characters.
 		<font> can be full pathname, or just filename.  Use %tfdir
 		for setting default font directory.
 
Index: kit/configure
diff -u kit/configure:1.59 kit/configure:1.60
--- kit/configure:1.59	Mon May 24 00:56:27 1999
+++ kit/configure	Thu May 27 12:22:50 1999
@@ -1028,7 +1028,7 @@
 		fi
  		if test -d $dir/lib -a -f $dir/lib/$shlib1; then
  			ac_cv_ft_lib="$dir/lib"
- 			ac_cv_ft_libpath=`ls $dir/lib/$shlib1`
+ 			ac_cv_ft_libpath="$shlib1"
  		elif test -d $dir/lib -a -f $dir/lib/libttf.a; then
  			ac_cv_ft_lib="$dir/lib"
  			ac_cv_ft_libpath="libttf.a"
Index: kit/configure.in
diff -u kit/configure.in:1.56 kit/configure.in:1.57
--- kit/configure.in:1.56	Mon May 24 00:56:29 1999
+++ kit/configure.in	Thu May 27 12:22:52 1999
@@ -3,7 +3,7 @@
 dnl independent (using srcdir), however, xmkmf and Imake.tmpl do not
 dnl allow us to switch compilation directory.
 dnl
-dnl $Id: configure.in,v 1.56 1999/05/23 15:56:29 nishida Exp $
+dnl $Id: configure.in,v 1.57 1999/05/27 03:22:52 nishida Exp $
 AC_INIT(image/imagetypes.c)
 
 dnl Checks for programs.
@@ -74,7 +74,7 @@
 		fi
  		if test -d $dir/lib -a -f $dir/lib/$shlib1; then
  			ac_cv_ft_lib="$dir/lib"
- 			ac_cv_ft_libpath=`ls $dir/lib/$shlib1`
+ 			ac_cv_ft_libpath="$shlib1"
  		elif test -d $dir/lib -a -f $dir/lib/libttf.a; then
  			ac_cv_ft_lib="$dir/lib"
  			ac_cv_ft_libpath="libttf.a"
Index: kit/ctlwords.pl
diff -u kit/ctlwords.pl:1.2 kit/ctlwords.pl:removed
--- kit/ctlwords.pl:1.2	Sat Sep  5 06:05:08 1998
+++ kit/ctlwords.pl	Mon May 31 05:10:11 1999
@@ -1,12 +0,0 @@
-#! /usr/bin/perl
-$counter = 0;	# 0 origin
-print "/* generated by ctlwords.awk. do not edit by hand. */\n";
-
-while (<>) {
-	next if (!/^\/\*CTL\*\//);
-	next if ($_ !~ /(CTL_[A-Z0-9]+)/);
-
-	$word = $1;
-	print "#define $word\t$counter\n";
-	$counter++;
-}
Index: kit/draw.c
diff -u kit/draw.c:1.146 kit/draw.c:1.149
--- kit/draw.c:1.146	Sun May 16 02:55:38 1999
+++ kit/draw.c	Sun May 30 01:38:35 1999
@@ -26,7 +26,7 @@
  * SUCH DAMAGE.
  */
 /*
- * $Id: draw.c,v 1.146 1999/05/15 17:55:38 nishida Exp $
+ * $Id: draw.c,v 1.149 1999/05/29 16:38:35 nishida Exp $
  */
 
 #include "mgp.h"
@@ -393,10 +393,14 @@
 		if (ttykey_enable)
 			FD_SET(0, &fds);
 #endif
-
+		remapchild();
 		/* always cache next page */
-		if ((mgp_flag & FL_FRDCACHE) && cache_mode)
+		if ((mgp_flag & FL_FRDCACHE) && cache_mode){
 			cache_page(&cache_state, state->page +1);
+			/* check if we got some events during caching */
+			if (XCheckMaskEvent(display, emask, e) == True) 
+  				goto got_event;
+		}
 
 		/* wait for something */
 		tout.tv_sec = 2;
@@ -2735,7 +2739,7 @@
 	/* wait for a while, please. */
 	if (!curs)
 		curs = XCreateFontCursor(display, XC_watch);
-	XDefineCursor(display, state->target, curs);
+	XDefineCursor(display, window, curs);
 	XFlush(display);
 
 	if (findImage(filename, fullname) < 0) {
@@ -2793,7 +2797,7 @@
 	if (imagefile == NULL) {
 		fprintf(stderr, "WARN: cannot generate %s file from %s\n",
 			gsdevice, filename);
-		XUndefineCursor(display, state->target);
+		XUndefineCursor(display, window);
 		XFlush(display);
 		return;
 	}
Index: kit/keywords.pl
diff -u kit/keywords.pl:1.1 kit/keywords.pl:removed
--- kit/keywords.pl:1.1	Tue Nov 11 15:07:40 1997
+++ kit/keywords.pl	Mon May 31 05:10:14 1999
@@ -1,14 +0,0 @@
-@keywords = ();
-
-die if (@ARGV != 1);
-open(IN, "< $ARGV[0]") || die;
-while (<IN>) {
-	next if (! /^\/\*CTL\*\//);
-	next if (! /CTL_([A-Z0-9]+),/);
-	$t = $1;
-	$t =~ tr/A-Z/a-z/;
-	push(@keywords, $t);
-}
-close(IN);
-
-print join(' ', @keywords) . "\n";
Index: kit/mgp.c
diff -u kit/mgp.c:1.99 kit/mgp.c:1.100
--- kit/mgp.c:1.99	Sun May 16 02:39:40 1999
+++ kit/mgp.c	Sun May 30 01:38:37 1999
@@ -26,7 +26,7 @@
  * SUCH DAMAGE.
  */
 /*
- * $Id: mgp.c,v 1.99 1999/05/15 17:39:40 nishida Exp $
+ * $Id: mgp.c,v 1.100 1999/05/29 16:38:37 nishida Exp $
  */
 
 static char *mgp_version = "1.04a (980906)";
@@ -1260,4 +1260,23 @@
 	}
 
 	return 0;
+}
+
+/*
+  remap child window which was invoked by xsystem directive.
+  this is an adhoc solution for window-maker.
+*/
+void
+remapchild()
+{
+	int	i;
+
+	for (i = 0; i < childidx; i++) {
+		if (childtab[i].window_id > 0){
+			XMapSubwindows(display, window);
+			XFlush(display);
+			return;
+		}
+	}
+	return;
 }
Index: kit/mgp.h
diff -u kit/mgp.h:1.106 kit/mgp.h:1.107
--- kit/mgp.h:1.106	Sun May 16 00:50:30 1999
+++ kit/mgp.h	Sun May 30 01:38:39 1999
@@ -26,7 +26,7 @@
  * SUCH DAMAGE.
  */
 /*
- * $Id: mgp.h,v 1.106 1999/05/15 15:50:30 nishida Exp $
+ * $Id: mgp.h,v 1.107 1999/05/29 16:38:39 nishida Exp $
  */
 
 #include <stdio.h>
@@ -585,6 +585,7 @@
 extern Window checkchildwin __P((void *));
 extern void regchild __P((pid_t, void *, Window, int));
 extern void purgechild __P((int));
+extern void remapchild __P((void));
 extern void cleanup __P((int));
 #ifdef TTY_KEYINPUT
 extern void try_enable_ttykey __P((void));
Index: kit/print.c
diff -u kit/print.c:1.79 kit/print.c:1.81
--- kit/print.c:1.79	Sun May 16 00:50:33 1999
+++ kit/print.c	Tue May 25 18:44:30 1999
@@ -26,7 +26,7 @@
  * SUCH DAMAGE.
  */
 /*
- * $Id: print.c,v 1.79 1999/05/15 15:50:33 nishida Exp $
+ * $Id: print.c,v 1.81 1999/05/25 09:44:30 nishida Exp $
  */
 /*
  * Paper size selection code is based on psutil.c by Angus J. C. Duggan
@@ -429,7 +429,7 @@
 		"/WIDTH %d def /HEIGHT %d def\n",
 		paper_xmargin, paper_ymargin, window_width, window_height);
 	fprintf(fp, "/XBODY WIDTH XMARGIN 2 mul sub def\n");
-	fprintf(fp, "/vertgap %d def /horizgap %d def\n", vert_gap, horiz_gap);
+	fprintf(fp, "/vertgap %d def /horizgap %d def\n", vert_gap[0], horiz_gap[0]);
 
 	/* define writebox */
 	fprintf(fp, "/writebox {\n");
@@ -572,7 +572,7 @@
 	switch(cp->ct_op) {
 	case CTL_SIZE:
 		char_size[0] = window_height * cp->ctf_value / 100;
-		fprintf(fp, "%d setcharsize\n", char_size);
+		fprintf(fp, "%d setcharsize\n", char_size[0]);
 		break;
 
 #ifdef VFLIB
Index: kit/x11.c
diff -u kit/x11.c:1.23 kit/x11.c:1.24
--- kit/x11.c:1.23	Sun May 16 02:39:41 1999
+++ kit/x11.c	Thu May 27 12:22:53 1999
@@ -26,7 +26,7 @@
  * SUCH DAMAGE.
  */
 /*
- * $Id: x11.c,v 1.23 1999/05/15 17:39:41 nishida Exp $
+ * $Id: x11.c,v 1.24 1999/05/27 03:22:53 nishida Exp $
  */
 
 #include "mgp.h"
@@ -312,7 +312,7 @@
 
 	if (!(mgp_flag & FL_OVER)) {
 		XGetInputFocus(display, &dummy, &revert);
-		XSetInputFocus(display, window, revert, CurrentTime);
+		XSetInputFocus(display, window, RevertToParent, CurrentTime);
 		if (XGrabKeyboard(display, window, True, 
 			GrabModeAsync, GrabModeAsync, CurrentTime)
 				!= GrabSuccess) {
Index: kit/image/Imakefile.in
diff -u kit/image/Imakefile.in:1.5 kit/image/Imakefile.in:1.6
--- kit/image/Imakefile.in:1.5	Fri Feb 12 16:53:16 1999
+++ kit/image/Imakefile.in	Thu May 27 12:22:58 1999
@@ -1,4 +1,4 @@
-TARGET0=	image
+TARGET0=	mgpimage
 TARGET=	lib$(TARGET0).a
 SRCS=	imagetypes.c gif.c send.c zio.c zoom.c new.c compress.c reduce.c\
 	value.c misc.c rotate.c rle.c rlelib.c smooth.c halftone.c clip.c\
