Index: kit/README.fonts
diff -u kit/README.fonts:1.17 kit/README.fonts:1.20
--- kit/README.fonts:1.17	Mon Sep  7 15:20:20 1998
+++ kit/README.fonts	Fri Apr 23 17:35:52 1999
@@ -1,6 +1,6 @@
 	    Configuring fonts for MagicPoint presentation
 
-$Id: README.fonts,v 1.17 1998/09/07 06:20:20 itojun Exp $
+$Id: README.fonts,v 1.20 1999/04/23 08:35:52 itojun Exp $
 
 For better presentation with "MagicPoint" presentation tool, it is
 necessary to configure your MagicPoint, and maybe your X11 server to
@@ -136,6 +136,16 @@
 	http://come.to/freefonts
 	CTAN mirros, pub/CTAN/fonts/cm/ps-type1/bakoma/ttf
 		Computer modern fonts in TrueType format
+	http://www.linux.or.jp/~ishikawa/linux/X-TT/
+		Freely redistributable Japanese fonts are converted into
+		TrueType format.  (Wadalab gothic and Watanabe mincho)
+
+	http://members.aol.com/JR9er/index.html
+	http://members.xoom.com/acidfonts/
+	http://dingbats.i-us.com/
+	http://www.freestuffcenter.com/fonts.html
+	http://www.fontpool.com/
+		TrueType font collections and collections of links.
 
 Also there are several sources for free-of-charge fonts, with some
 licensing things:
Index: kit/README.fonts.jp
diff -u kit/README.fonts.jp:1.7 kit/README.fonts.jp:1.10
--- kit/README.fonts.jp:1.7	Mon Sep  7 15:20:21 1998
+++ kit/README.fonts.jp	Fri Apr 23 17:35:54 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.7 1998/09/07 06:20:21 itojun Exp $
+$Id: README.fonts.jp,v 1.10 1999/04/23 08:35:54 itojun Exp $
 
 	-----$BF|K\8lHG(B(README.fonts.jp)$B$K4X$9$kCm0U(B-----
 	$B1Q8lHG(B(README.fonts)$B$NJ}$,@5<0$G$9!#(B
@@ -181,6 +181,16 @@
 	http://come.to/freefonts
 	CTAN mirros, pub/CTAN/fonts/cm/ps-type1/bakoma/ttf
 		Computer modern fonts in TrueType format
+	http://www.linux.or.jp/~ishikawa/linux/X-TT/
+		$BG[I[<+M3$J%U%)%s%H$,(BTrueType$B%U%)!<%^%C%H$KJQ49$5$l$F(B
+		$BCV$$$F$"$j$^$9!#(B($BOBED8&%4%7%C%/$HEOJUL@D+(B)
+
+	http://members.aol.com/JR9er/index.html
+	http://members.xoom.com/acidfonts/
+	http://dingbats.i-us.com/
+	http://www.freestuffcenter.com/fonts.html
+	http://www.fontpool.com/
+		TrueType$B%U%)%s%H=8!"$^$?$O%j%s%/=8(B
 
 $B$^$?!"0J2<$N%5%$%H$G<hF@$G$-$k%U%)%s%H$O!"L5NA$G$9$,%i%$%;%s%9$K>/$7Ld(B
 $BBj$,$"$j$^$9!#(B
Index: kit/README.lang
diff -u kit/README.lang:1.1 kit/README.lang:1.2
--- kit/README.lang:1.1	Sun Mar 28 15:33:19 1999
+++ kit/README.lang	Fri Apr 23 19:56:57 1999
@@ -1,11 +1,16 @@
-Making multilingual presentatoins with Magicpoint
-$Id: README.lang,v 1.1 1999/03/28 06:33:19 itojun Exp $
+Making multilingual presentations with Magicpoint
+$Id: README.lang,v 1.2 1999/04/23 10:56:57 itojun Exp $
 
 
 Magicpoint has no idea about what kind of character set you are using
 with your presentation file, or what kind of language you are using.
 For example, if you use Latin-1 (iso-8859-1) you MUST tell that explicitly
 to Magicpoint.
+
+In the future, we will be adding a Magicpoint directive to specify
+the encoding of the file explicitly, like:
+	%charset "iso-8859-1"
+	%charset "iso-2022-jp"
 
 
 Making Magicpoint presentations in European language
Index: kit/SYNTAX
diff -u kit/SYNTAX:1.21 kit/SYNTAX:1.23
--- kit/SYNTAX:1.21	Sun Nov 15 02:16:04 1998
+++ kit/SYNTAX	Fri Apr 23 15:07:35 1999
@@ -1,4 +1,4 @@
-$Id: SYNTAX,v 1.21 1998/11/14 17:16:04 itojun Exp $
+$Id: SYNTAX,v 1.23 1999/04/23 06:07:35 itojun Exp $
 
 placement restriction for directives:
 		.mgprc		preamble	main pages
@@ -135,7 +135,7 @@
 	<length> :: length percent of display width. default 100.
 
 %image "imagefile" <numcolor> <xzoomrate> <yzoomrate> <zoomflag>
-%image "imagefile" [<numcolor>] <screensize>
+%image "imagefile" [ [<numcolor>] <screensize> ]
 	"imagefile" :: name of image file
 	<numcolor> :: number of colors, 0 means no reduction.
 	<xzoomrate> :: height percentage against physical display or original
@@ -153,14 +153,29 @@
 	Note that if the image is a binary image, current foreground
 	and background colors are applied to the drawn image.
 
-%newimage [-colors numcolor] [-zoom zoomrate] [-xyzoom xzoomrate yzoomrate]
-	[-scrzoom zoomrate] [-xyscrzoom xzoomrate yzoomrate] "imagefile"
+%newimage [options] "imagefile"
 
 	Same as %image, but it is much easier to understand.
+	options include:
+	    -colors numcolors
+	    -xysize piel pixel
+	    -zoom percentage
+	    -xyzoom x-percentage y-percentage
+		Percentage is against the original image.
+		"100" means the original image size, "50" means
+		half the original image size.
+	    -scrzoom percentage
+	    -xscrzoom percentage
+	    -yscrzoom percentage
+	    -xyscrzoom x-percentage y-percentage
+		Percentage is against the screen. "100" means screen
+		width/height, "50" means half the screen width/height.
+		-xscrzoom and -yscrzoom scales image with aspect
+		ratio unchanged.
+
 	TODO: supersede %image by %newimage?
-	TODO: option for auto resize mode
-	TODO: a new zoom mode, which allows screen-relative zoom without
-		changing aspect ratio
+	TODO: option for auto resize mode (fit image into the room left on
+		the screen)
 
 %prefix "string"
 	Place "string" at the beginning of line.
Index: kit/configure
diff -u kit/configure:1.54 kit/configure:1.55
--- kit/configure:1.54	Mon Apr 12 03:14:13 1999
+++ kit/configure	Fri Apr 23 17:14:24 1999
@@ -2573,4 +2573,4 @@
 
 /bin/rm -f Makefile image/Makefile
 
-echo "be sure to generate Makefile from Imakefile, xmkmf and make Makefiles"
+echo "be sure to generate Makefile from Imakefile, by xmkmf and make Makefiles"
Index: kit/configure.in
diff -u kit/configure.in:1.51 kit/configure.in:1.52
--- kit/configure.in:1.51	Mon Apr 12 03:14:15 1999
+++ kit/configure.in	Fri Apr 23 17:14:25 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.51 1999/04/11 18:14:15 nishida Exp $
+dnl $Id: configure.in,v 1.52 1999/04/23 08:14:25 itojun Exp $
 AC_INIT(image/imagetypes.c)
 
 dnl Checks for programs.
@@ -234,4 +234,4 @@
 
 /bin/rm -f Makefile image/Makefile
 
-echo "be sure to generate Makefile from Imakefile, xmkmf and make Makefiles"
+echo "be sure to generate Makefile from Imakefile, by xmkmf and make Makefiles"
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 Apr 26 05:10:10 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.139 kit/draw.c:1.143
--- kit/draw.c:1.139	Mon Apr 12 03:14:16 1999
+++ kit/draw.c	Sat Apr 24 11:43:00 1999
@@ -26,7 +26,7 @@
  * SUCH DAMAGE.
  */
 /*
- * $Id: draw.c,v 1.139 1999/04/11 18:14:16 nishida Exp $
+ * $Id: draw.c,v 1.143 1999/04/24 02:43:00 itojun Exp $
  */
 
 #include "mgp.h"
@@ -84,7 +84,7 @@
 #endif
 #ifdef FREETYPE
 static u_int draw_onechar_tf __P((struct render_state *, u_int, int, int,
-	u_int, int, int));
+	u_int, char *, int, int));
 #endif
 static char *x_fontname __P((char *, int, char *, int, char *));
 static int x_parsefont __P((char *, int *, int*));
@@ -372,6 +372,7 @@
 		tout.tv_sec = 2;
 		tout.tv_usec = 0;
 		(void)select(xfd + 1, &fds, NULL, NULL, &tout);
+		timebar(state);
 #ifdef TTY_KEYINPUT
 		if (!(mgp_flag & FL_NOSTDIN) && !ttykey_enable)
 			try_enable_ttykey();
@@ -1030,22 +1031,24 @@
 			 && strncmp(registry, "jisx0208.1983-", 14) == 0)
 				mode = MODE_VFLIB;
 #endif
-			if (mode == MODE_UNKNOWN)
-#ifdef FREETYPE
-				mode = MODE_X;
-				if (!(mgp_flag & FL_NOFREETYPE)) {
-					if (tfc_get(code, char_size, 1, charset16)){
-						mode = MODE_FREETYPE;
-					}
-
+#ifdef FREETYPE_CHARSET16
+			if (!(mgp_flag & FL_NOFREETYPE)
+			 && strncmp(registry, "jisx0208.1983-", 14) == 0) {
+				if (tfc_get(code, char_size, 1, registry,
+						charset16)){
+					mode = MODE_FREETYPE;
 				}
-#else
+			}
 #endif
+			if (mode == MODE_UNKNOWN)
+				mode = MODE_X;
 		} else {
 #ifdef FREETYPE
 			if (!(mgp_flag & FL_NOFREETYPE)) {
-				if (tfc_get(code, char_size, 1, charset16))
+				if (tfc_get(code, char_size, 1, registry,
+						charset16)) {
 					mode = MODE_FREETYPE;
+				}
 			}
 #endif
 			if (mode == MODE_UNKNOWN) {
@@ -1097,7 +1100,7 @@
 			 */
 			char_len = draw_onechar_tf(state, code,
 				state->linewidth, 0,
-				char_size,
+				char_size, registry,
 				(len == (charset16 ? 2 : 1)) ? 1 : 0,
 				charset16);
 			break;
@@ -3565,18 +3568,19 @@
 
 #ifdef FREETYPE
 static u_int
-draw_onechar_tf(state, code, x, y, size, lastchar, charset16)
+draw_onechar_tf(state, code, x, y, size, registry, lastchar, charset16)
 	struct render_state *state;
 	u_int code;
 	int x, y;
 	u_int size;
+	char *registry;
 	int lastchar;
 	int	charset16;
 {
 	struct tfont *tfc;
 	int charlen;
 
-	tfc = tfc_get(code, size, 1, charset16);
+	tfc = tfc_get(code, size, 1, registry, charset16);
 	draw_line_itemsize(state, tfc->ascent, tfc->descent);
 
 	/* usually */
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 Apr 26 05:10:13 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.96 kit/mgp.c:1.97
--- kit/mgp.c:1.96	Mon Apr 12 03:14:21 1999
+++ kit/mgp.c	Mon Apr 26 01:34:40 1999
@@ -26,7 +26,7 @@
  * SUCH DAMAGE.
  */
 /*
- * $Id: mgp.c,v 1.96 1999/04/11 18:14:21 nishida Exp $
+ * $Id: mgp.c,v 1.97 1999/04/25 16:34:40 itojun Exp $
  */
 
 static char *mgp_version = "1.04a (980906)";
@@ -972,6 +972,7 @@
 
 		case KeyRelease:
 			key = XLookupKeysym((XKeyEvent *)&e, 0);
+
 			switch (key) {
 			case XK_Control_L:
 			case XK_Control_R:
Index: kit/mgp.h
diff -u kit/mgp.h:1.104 kit/mgp.h:1.105
--- kit/mgp.h:1.104	Mon Apr 12 03:14:22 1999
+++ kit/mgp.h	Sat Apr 24 11:43:03 1999
@@ -26,7 +26,7 @@
  * SUCH DAMAGE.
  */
 /*
- * $Id: mgp.h,v 1.104 1999/04/11 18:14:22 nishida Exp $
+ * $Id: mgp.h,v 1.105 1999/04/24 02:43:03 itojun Exp $
  */
 
 #include <stdio.h>
@@ -642,7 +642,7 @@
 
 /* tfont.c */
 extern int tfc_setsize __P((u_int));
-extern struct tfont *tfc_get __P((u_int, u_int, int, int));
+extern struct tfont *tfc_get __P((u_int, u_int, int, char *, int));
 extern void tfc_setfont __P((char *, int));
 extern XImage *tfc_image __P((struct tfont *, long, long, XImage *, int, int));
 
Index: kit/print.c
diff -u kit/print.c:1.77 kit/print.c:1.78
--- kit/print.c:1.77	Wed Mar 24 03:59:34 1999
+++ kit/print.c	Fri Apr 23 19:28:20 1999
@@ -26,7 +26,7 @@
  * SUCH DAMAGE.
  */
 /*
- * $Id: print.c,v 1.77 1999/03/23 18:59:34 nishida Exp $
+ * $Id: print.c,v 1.78 1999/04/23 10:28:20 itojun Exp $
  */
 /*
  * Paper size selection code is based on psutil.c by Angus J. C. Duggan
@@ -118,6 +118,10 @@
 	{ CTL_TFONT, ASCII, "courbd.ttf",	"Courier-Bold" },
 	{ CTL_TFONT, ASCII, "courbi.ttf",	"Courier-BoldOblique" },
 	{ CTL_TFONT, ASCII, "*",		"Helvetica" },	/*last resort*/
+#ifdef FREETYPE_CHARSET16
+	{ CTL_TMFONT, KANJI, "wadalab-gothic.ttf", "GothicBBB-Medium-H" },
+	{ CTL_TMFONT, KANJI, "*",		"Ryumin-Light-H" },
+#endif
 #endif /*FREETYPE*/
 	{ CTL_XFONT2, ASCII, "times-medium-r",	"Times-Roman" },
 	{ CTL_XFONT2, ASCII, "times-medium-i",	"Times-Italic" },
@@ -334,6 +338,15 @@
 				if (font)
 					curfont[ASCII] = font;
 				break;
+
+#ifdef FREETYPE_CHARSET16
+			case CTL_TMFONT:
+				font = findfont(cp->ct_op, KANJI,
+					cp->ctc_value);
+				if (font)
+					curfont[KANJI] = font;
+				break;
+#endif /*FREETYPE_CHARSET16*/
 #endif
 
 			case CTL_XFONT2:
@@ -576,6 +589,14 @@
 		if (font)
 			curfont[ASCII] = font;
 		break;
+
+#ifdef FREETYPE_CHARSET16
+	case CTL_TMFONT:
+		font = findfont(cp->ct_op, KANJI, cp->ctc_value);
+		if (font)
+			curfont[KANJI] = font;
+		break;
+#endif /*FREETYPE_CHARSET16*/
 #endif
 
 	case CTL_XFONT2:
@@ -1920,6 +1941,11 @@
 loadfont(font)
 	struct fontmap *font;
 {
+	if (!font) {
+		fprintf(fp, "unable to find proper font\n");
+		exit(1);
+	}
+
 	if (font->loaded)
 		return;
 
Index: kit/tfont.c
diff -u kit/tfont.c:1.28 kit/tfont.c:1.29
--- kit/tfont.c:1.28	Mon Apr 12 14:50:36 1999
+++ kit/tfont.c	Sat Apr 24 11:43:04 1999
@@ -26,7 +26,7 @@
  * SUCH DAMAGE.
  */
 /*
- * $Id: tfont.c,v 1.28 1999/04/12 05:50:36 nishida Exp $
+ * $Id: tfont.c,v 1.29 1999/04/24 02:43:04 itojun Exp $
  */
 
 #include "mgp.h"
@@ -85,8 +85,8 @@
 static void tfc_init __P((void));
 static void tfc_free __P((struct tfont *));
 static struct tfont *tfc_lookup __P((u_int, u_int, char*));
-static struct tfont *tfc_alloc __P((u_int, u_int, char *));
-static short CharToUnicode __P((u_int));
+static struct tfont *tfc_alloc __P((u_int, u_int, char *, char *));
+static short CharToUnicode __P((u_int, char *));
 static short jistosjis __P((u_int));
 static TT_Error LoadTrueTypeChar __P((int, int));
 
@@ -155,9 +155,10 @@
 }
 
 struct tfont *
-tfc_get(code, size, force, charset16)
+tfc_get(code, size, force, registry, charset16)
 	u_int code, size;
 	int force;
+	char *registry;
 	int charset16;
 {
 	struct tfont *tfc, *ntfc;
@@ -187,9 +188,9 @@
 		}
 
 		if (charset16)
-			tfc = tfc_alloc(code, size, tf_mcurname);
+			tfc = tfc_alloc(code, size, tf_mcurname, registry);
 		else
-			tfc = tfc_alloc(code, size, tf_curname);
+			tfc = tfc_alloc(code, size, tf_curname, registry);
 	}
 	return tfc;
 }
@@ -402,9 +403,10 @@
 }
 
 static struct tfont *
-tfc_alloc(code, size, fontname)
+tfc_alloc(code, size, fontname, registry)
 	u_int code, size;
 	char *fontname;
+	char *registry;
 {
 	struct tfont *tfc;
 	short unicode;
@@ -434,7 +436,7 @@
 	}
 
 #if 1
-	unicode = CharToUnicode(code);
+	unicode = CharToUnicode(code, registry);
 #else
 	unicode = code;
 #endif
@@ -502,8 +504,9 @@
 }
 
 static short
-CharToUnicode(code)
+CharToUnicode(code, registry)
 	u_int code;
+	char *registry;
 {
 	TT_CharMap      char_map;
 	unsigned short  i, n;
@@ -529,11 +532,21 @@
 		 || (platform == 0 && encoding == 0)) {
 			TT_Get_CharMap(face[tfcuridx], i, &char_map);
 #ifdef FREETYPE_CHARSET16
-			if (code > 256) code = unicode_map[code];
+			if (code > 256 && strncmp(registry, "jisx0208.1983-", 14) != 0) {
+				/*
+				 * unicode_map assumes JIS X0208.
+				 * it is not usable for other encodings.
+				 * try the next CharMap available.
+				 */
+				continue;
+			}
+			if (code > 256)
+				code = unicode_map[code];
 #endif /* FREETYPE_CHARSET16 */
 			return TT_Char_Index(char_map, (short) code);
+		}
 #ifdef FREETYPE_CHARSET16
-		} else {
+		else {
 			/*
 			 * very adhoc processing for truetype fonts generated by cb2ttj.
 			 */
@@ -550,10 +563,7 @@
 				}
 			}
 		}
-#else
-		}
-#endif /* FREETYPE_CHARSET16 */
-
+#endif
 	}
 
 	fprintf(stderr, "Sorry, but the fontfile \"%s\" doesn't "
