Index: kit/CHANGELOG
diff -u kit/CHANGELOG:1.9 kit/CHANGELOG:removed
--- kit/CHANGELOG:1.9	Sat Sep  5 00:11:21 1998
+++ kit/CHANGELOG	Mon Jul 19 05:10:00 2004
@@ -1,51 +0,0 @@
-CHANGELOG for magicpoint
-$Id: CHANGELOG,v 1.9 1998/09/04 15:11:21 onoe Exp $
-
-Fri Sep  5 1998  onoe@sm.sony.co.jp
-	* handle key inputs from invoked terminal as pressed on Xserver,
-	  even if the Xserver is running on a remote host.
-
-Mon Aug 26 1998  itojun@iijlab.net
-	* new copyright. (BSDish copyright without clause 3)
-
-Mon Aug 25 1998  itojun@iijlab.net
-	* print.c: better x11/freetype/vflib -> postscript font mapping.
-
-Mon Aug 23 1998  kato@wide.ad.jp
-	* embedded image support (added mgpembed.pl and embed.c)
-
-Mon Aug 22 1998  itojun@iijlab.net
-	* added contrib/xmindpath, MindPath PocketPoint user-level driver.
-
-Fri Jul 10 11:57:59 JST 1998  itojun@iijlab.net
-	* cache gs-generated image file.
-	  Suggested by: luigi@FreeBSD.org
-
-Mon Jul  6 11:38:32 JST 1998  itojun@iijlab.net
-	* capable of handling GB2312 and KSC5601 encoding.
-	  they must be encoded by using iso-2022 like escape sequences.
-	  EUC-cn or EUC-kr does not work.
-	* -x option is added.
-
-Thu Jul  2 18:04:16 JST 1998  itojun@iijlab.net
-	* eliminate gsview.
-	* revamp "xfont" directive. (see SYNTAX for detail)
-
-Thu Jun 25 13:10:28 JST 1998  itojun@iijlab.net
-	* print.c: color postscript support by "mgp2ps -c".
-
-changes between 1.02a and 1.03a:
-	* To allow color name that has space inbetween ("dark blue"), 
-	  color name after directives SHOULD come with doublequote.
-	  Therefore,
-		%fore blue
-	  should be
-		%fore "blue"
-	  At this moment, doublequote can be ommitted for backward
-	  compatibility.  We may require to have doublequote in the future.
-	  Font names and other string parameter obeys the same rule.
-	* %image is now capable of rendering encapsulated postscript files
-	  (*.eps).
-		%image foo.eps
-	  should work fine.
-	  By using -X option, you can specify device name for ghostscript.
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 Jul 19 05:10:00 2004
@@ -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.218 kit/draw.c:1.219
--- kit/draw.c:1.218	Fri Jul  9 23:27:02 2004
+++ kit/draw.c	Fri Jul 16 14:28:08 2004
@@ -26,7 +26,7 @@
  * SUCH DAMAGE.
  */
 /*
- * $Id: draw.c,v 1.218 2004/07/09 14:27:02 nishida Exp $
+ * $Id: draw.c,v 1.219 2004/07/16 05:28:08 nishida Exp $
  */
 
 #include "mgp.h"
@@ -66,7 +66,7 @@
 
 static int set_position __P((struct render_state *));
 static void draw_line_start __P((struct render_state *));
-void draw_line_itemsize __P((struct render_state *, int, int));
+void draw_line_itemsize __P((struct render_state *, int, int, int));
 static void draw_line_output __P((struct render_state *, char *));
 static void draw_line_end __P((struct render_state *));
 static void cutin __P((struct render_state *, int, int, int));
@@ -952,10 +952,11 @@
 }
 
 void
-draw_line_itemsize(state, ascent, descent)
+draw_line_itemsize(state, ascent, descent, flheight)
 	struct render_state *state;
 	int ascent;
 	int descent;
+	int flheight;
 {
 	ascent -= state->charoff;
 	descent += state->charoff;
@@ -974,6 +975,9 @@
 		if (descent > state->max_linedescent)
 			state->max_linedescent = descent;
 	}
+
+	if (flheight > state->maxflheight)
+		state->maxflheight = flheight;
 }
 
 
@@ -1487,7 +1491,7 @@
 		for (tail = state->obj; tail; tail = tail->next) {
 			tail->x -= startwidth;
 			tail->x += state->leftfillpos;
-			draw_line_itemsize(state, tail->ascent, tail->descent);
+			draw_line_itemsize(state, tail->ascent, tail->descent, 0);
 		}
 	}
 	return p;
@@ -1727,7 +1731,10 @@
 	obj->vertloc = VL_CENTER;
 #ifdef USE_M17N
 	// Adjust icon position for line folding function
-	obj->vertloc = VL_TOP;
+	if (mgp_flag & FL_NOM17N)
+		obj->vertloc = VL_CENTER;
+	else
+		obj->vertloc = VL_ICENTER;
 #endif
 	return 1;
 }
@@ -2191,6 +2198,13 @@
 		case VL_BASE:
 			y = state->maxascent;
 			break;
+		case VL_ICENTER:
+			if (state->maxflheight){
+				y = (state->maxascent + state->maxflheight) / 2;
+			} else
+				y = (state->maxascent + state->maxdescent) / 2;
+			y += (obj->ascent - obj->descent) / 2;
+			break;
 		case VL_CENTER:
 			y = (state->maxascent + state->maxdescent) / 2;
 			y += (obj->ascent - obj->descent) / 2;
@@ -2323,7 +2337,7 @@
 	struct vfont *vfc;
 
 	vfc = vfc_get(code, width, height, 1);
-	draw_line_itemsize(state, vfc->ascent, vfc->descent);
+	draw_line_itemsize(state, vfc->ascent, vfc->descent, 0);
 
 	obj_new_vfont(state, x, y, vfc, height);
 	return vfc->charlen;
@@ -2718,7 +2732,7 @@
 		cs = &xfontstruct->max_bounds;
 	}
 
-	draw_line_itemsize(state, cs->ascent, cs->descent);
+	draw_line_itemsize(state, cs->ascent, cs->descent, 0);
 
 	/* usually */
 	charlen = cs->width;
@@ -3035,14 +3049,14 @@
 
 	switch(valign){
 	case VL_TOP:
-		draw_line_itemsize(state, 0, height * yzoomrate / 100);
+		draw_line_itemsize(state, 0, height * yzoomrate / 100, 0);
 		break;
 	case VL_BOTTOM:
-		draw_line_itemsize(state, height * yzoomrate / 100, 0);
+		draw_line_itemsize(state, height * yzoomrate / 100, 0, 0);
 		break;
 	case VL_CENTER:
 		draw_line_itemsize(state, height * yzoomrate / 200, 
-			height * yzoomrate / 200);
+			height * yzoomrate / 200, 0);
 		break;
 	}
 
@@ -4011,7 +4025,7 @@
 	int charlen;
 
 	tfc = tfc_get(code, size, 1, registry, charset16);
-	draw_line_itemsize(state, tfc->ascent, tfc->descent);
+	draw_line_itemsize(state, tfc->ascent, tfc->descent, 0);
 
 	/* usually */
 	charlen = tfc->charlen;
@@ -4567,13 +4581,13 @@
 
 	switch(valign){
 	case VL_TOP:
-		draw_line_itemsize(state, 0, height);
+		draw_line_itemsize(state, 0, height, 0);
 		break;
 	case VL_BOTTOM:
-		draw_line_itemsize(state, height, 0);
+		draw_line_itemsize(state, height, 0, 0);
 		break;
 	case VL_CENTER:
-		draw_line_itemsize(state, height /2 , height /2);
+		draw_line_itemsize(state, height /2 , height /2, 0);
 		break;
 	}
 
@@ -4672,7 +4686,7 @@
 			state->linewidth = state->leftfillpos;
 		}
 
-		draw_line_itemsize(state, xft_font->ascent, xft_font->descent);
+		draw_line_itemsize(state, xft_font->ascent, xft_font->descent, 0);
 		if (obj_new_xftfont(state, state->linewidth, 0, out16,
 		    sizeof(out16) - oleft, fontname, registry,
 		    char_size[caching], charset16, xft_font)) {
@@ -4701,9 +4715,9 @@
 nofolding:
 
 #if 1
-	draw_line_itemsize(state, xft_font->ascent, xft_font->descent);
+	draw_line_itemsize(state, xft_font->ascent, xft_font->descent, 0);
 #else
-	draw_line_itemsize(state, extents.y, extents.height - extents.y);
+	draw_line_itemsize(state, extents.y, extents.height - extents.y, 0);
 #endif
 
 	if (obj_new_xftfont(state, state->linewidth, 0, p, len, fontname,
@@ -4830,12 +4844,12 @@
 		    XFT_FAMILY, XftTypeString, font,
 		    XFT_ENCODING, XftTypeString, registry,
 		    XFT_STYLE, XftTypeString, style,
-		    XFT_SIZE, XftTypeDouble, (float)csize * 0.75, 0);
+		    XFT_PIXEL_SIZE, XftTypeDouble, (float)csize, 0);
 	} else {
 		xftfont = XftFontOpen(display, screen,
 		    XFT_FAMILY, XftTypeString, font,
 		    XFT_ENCODING, XftTypeString, registry,
-		    XFT_SIZE, XftTypeDouble, (float)csize * 0.75, 0);
+		    XFT_PIXEL_SIZE, XftTypeDouble, (float)csize, 0);
 	}
 	if (xftfont == 0) {
 		free(xfont);
Index: kit/m17n.c
diff -u kit/m17n.c:1.1 kit/m17n.c:1.2
--- kit/m17n.c:1.1	Fri Jul  9 17:24:08 2004
+++ kit/m17n.c	Fri Jul 16 14:28:08 2004
@@ -26,7 +26,7 @@
  * SUCH DAMAGE.
  */
 /*
- * $Id: m17n.c,v 1.1 2004/07/09 08:24:08 nishida Exp $ 
+ * $Id: m17n.c,v 1.2 2004/07/16 05:28:08 nishida Exp $ 
  */
 
 #ifdef USE_M17N
@@ -266,7 +266,7 @@
 	MText *mt;
 	MDrawGlyphInfo info;
 	MDrawMetric rect;
-	int ascent = 0, descent = 0, i, n;
+	int ascent = 0, descent = 0, i, n, flheight = 0;
 	char tmptext[10000];
 	Bool flag_s, flag_c, flag_o;
 
@@ -307,6 +307,8 @@
 	mdraw_text_extents(drawframe, space, 0, 1,
 			   &control, NULL, &rect, NULL);
 	ascent = - rect.y, descent = rect.height + rect.y;
+	mdraw_text_extents(drawframe, mt, 0, 1, &control, &rect, NULL, NULL);
+	flheight = rect.height + rect.y;
 	mdraw_text_extents(drawframe, mt, 0, mtext_len(mt), 
 			   &control, &rect, NULL, NULL);
 	if (ascent < - rect.y)
@@ -316,7 +318,7 @@
 	if (rect.width > 0)
 	  state->brankline = 0;
 
-	draw_line_itemsize(state, ascent, descent);
+	draw_line_itemsize(state, ascent, descent, flheight);
 	if (obj_new_mtext(state, state->linewidth, 0, mt, 
 				drawframe, ascent, descent)){
 		state->linewidth += rect.width;
Index: kit/mgp.h
diff -u kit/mgp.h:1.137 kit/mgp.h:1.138
--- kit/mgp.h:1.137	Thu Jul  8 15:09:54 2004
+++ kit/mgp.h	Fri Jul 16 14:28:08 2004
@@ -26,7 +26,7 @@
  * SUCH DAMAGE.
  */
 /*
- * $Id: mgp.h,v 1.137 2004/07/08 06:09:54 nishida Exp $
+ * $Id: mgp.h,v 1.138 2004/07/16 05:28:08 nishida Exp $
  */
 
 #include <stdio.h>
@@ -62,7 +62,8 @@
 #include <X11/cursorfont.h>
 #include <X11/Xatom.h>
 #ifdef USE_XFT2
-#include <freetype/freetype.h>
+#include <ft2build.h>
+#include FT_FREETYPE_H
 #include <fontconfig/fontconfig.h>
 #include <X11/Xft/Xft.h>
 #ifdef HAVE_ICONV
@@ -439,6 +440,7 @@
 	u_int repaint;
 	int maxascent;
 	int maxdescent;
+	int maxflheight;
 	int max_lineascent;   /* max size above baseline ignoring supscript */
 	int max_linedescent;  /* max size below baseline ignoring subscript */
 	u_int linewidth;
@@ -460,6 +462,7 @@
 #define VL_CENTER	1
 #define VL_TOP		2
 #define VL_BOTTOM	3
+#define VL_ICENTER	4
 	enum {
 #ifdef VFLIB
 		O_VFONT,
@@ -828,4 +831,3 @@
 char * M17N_draw_fragment __P((struct render_state *, u_char *, u_int));
 void M17N_draw_object __P((struct render_object *, Drawable, int, int));
 #endif
-
Index: kit/image/gif.h
diff -u kit/image/gif.h:1.2 kit/image/gif.h:removed
--- kit/image/gif.h:1.2	Mon Dec 28 17:23:03 1998
+++ kit/image/gif.h	Mon Jul 19 05:10:01 2004
@@ -1,72 +0,0 @@
-/* gif.h:
- *
- * gifin.h
- * kirk johnson
- * november 1989
- * external interface to gifin.c
- *
- * Copyright 1989 Kirk L. Johnson (see the included file
- * "kljcpyrght.h" for complete copyright information)
- */
-
-/*
- * gifin return codes
- */
-#define GIFIN_SUCCESS       0   /* success */
-#define GIFIN_DONE          1   /* no more images */
-
-#define GIFIN_ERR_BAD_SD   -1   /* bad screen descriptor */
-#define GIFIN_ERR_BAD_SEP  -2   /* bad image separator */
-#define GIFIN_ERR_BAD_SIG  -3   /* bad signature */
-#define GIFIN_ERR_EOD      -4   /* unexpected end of raster data */
-#define GIFIN_ERR_EOF      -5   /* unexpected end of input stream */
-#define GIFIN_ERR_FAO      -6   /* file already open */
-#define GIFIN_ERR_IAO      -7   /* image already open */
-#define GIFIN_ERR_NFO      -8   /* no file open */
-#define GIFIN_ERR_NIO      -9   /* no image open */
-
-/*
- * colormap indices 
- */
-
-#define GIF_RED  0
-#define GIF_GRN  1
-#define GIF_BLU  2
-
-/*
- * typedef BYTE for convenience
- */
-
-typedef unsigned char BYTE;
-
-static int gifin_open_file();
-static int gifin_open_image();
-static int gifin_get_pixel();
-#if 0
-static int gifin_close_image();
-#endif
-static int gifin_close_file();
-static int gifin_load_cmap();
-static int gifin_skip_extension();
-static int gifin_read_data_block();
-static int gifin_push_string();
-static void gifin_add_string();
-static void gifin_fatal();
-
-/* #defines, typedefs, and such
- */
-
-#define GIF_SIG      "GIF87a"
-#define GIF_SIG_89   "GIF89a"
-#define GIF_SIG_LEN  6          /* GIF signature length */
-#define GIF_SD_SIZE  7          /* GIF screen descriptor size */
-#define GIF_ID_SIZE  9          /* GIF image descriptor size */
-
-#define GIF_SEPARATOR   ','     /* GIF image separator */
-#define GIF_EXTENSION   '!'     /* GIF extension block marker */
-#define GIF_TERMINATOR  ';'     /* GIF terminator */
-
-#define STAB_SIZE  4096         /* string table size */
-#define PSTK_SIZE  4096         /* pixel stack size */
-
-#define NULL_CODE  -1           /* string table null code */
Index: kit/sample/cloud.gif
Index: kit/sample/dad.gif
Index: kit/sample/dns-jp.mgp
diff -u kit/sample/dns-jp.mgp:1.5 kit/sample/dns-jp.mgp:removed
--- kit/sample/dns-jp.mgp:1.5	Fri Sep  4 21:33:18 1998
+++ kit/sample/dns-jp.mgp	Mon Jul 19 05:10:02 2004
@@ -1,130 +0,0 @@
-%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
-%%
-%%	This file is automatically created from the file
-%%	main.pre modified at Fri Jan 23 14:31:24 1998
-%%
-%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
-%%
-%include "default.mgp"
-%% "noop" cancels definitions in default.mgp
-%default 1 left, size 7, fore "light yellow", back "blue4", font "standard", ccolor "white", vgap 35
-%default 2 noop
-%default 3 fore "white", bar "gray70", vgap 10
-%default 4 noop
-%tab 1 noop
-%tab 2 noop
-%tab 3 noop
-%%%
-%page
-%nodefault
-%fore "red", back "blue4", size 9, vgap 15
-%center, fore "yellow", font "thick"
-%ccolor "white"
-
-
-
-Root DNS `M' $B$K$D$$$F(B
-
-%size 6, fore "red", font "thick"
-$B2CF#(B   $BO/(B
-
-%size 5, fore "white", font "standard"
-$BEl5~Bg3XBg7?7W;;5!%;%s%?!<(B
-
-
-%font "typewriter"
-kato@wide.ad.jp
-%font "standard"
-%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
-%page
-
-%back "blue4"
-  $B7P0^(B (1)
-%fore "red", size 6, font "thick"
-   $B!y(B Root DNS
-%fore "white", size 5, font "standard"
-       $B!&(B $B#9Bf$G1?MQ(B
-%fore "white", size 5, font "standard"
-          $B!](B $B#8Bf$,(B US
-          $B!](B Stockholm $B$K#1Bf(B
-%fore "white", size 5, font "standard"
-       $B!&(B $B:GBg$G#1#3Bf(B
-%fore "white", size 5, font "standard"
-          $B!](B $B%Q%1%C%HD9$N@)Ls(B
-%fore "red", size 6, font "thick"
-   $B!y(B Root DNS $B$N1?MQ4p=`(B
-%fore "white", size 5, font "standard"
-       $B!&(B RFC 2010
-       $B!&(B gTLD $B$H$N4X78(B
-%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
-%page
-
-%back "blue4"
-  $B7P0^(B (2)
-%fore "red", size 6, font "thick"
-   $B!y(B IEPG $B$G3HD%$r8!F$(B
-   $B!y(B $B%h!<%m%C%QCO0h(B
-%fore "white", size 5, font "standard"
-       $B!&(B LINX $B$K?7@_(B : 1997 $BG/(B 4 $B7n(B
-%fore "white", size 5, font "standard"
-          $B!](B RIPE/NCC $B$,4IM}(B
-          $B!](B `K'
-%fore "red", size 6, font "thick"
-   $B!y(B $B%"%8%"B@J?MNCO0h(B
-%fore "white", size 5, font "standard"
-       $B!&(B NSPIXP-2 $B!'(B 1997 $BG/(B 8 $B7n(B
-%fore "white", size 5, font "standard"
-          $B!](B WIDE $B$,4IM}(B
-          $B!](B `M'
-%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
-%page
-
-%back "blue4"
-  `M'
-%fore "red", size 6, font "thick"
-   $B!y(B $B9=@.(B
-%fore "white", size 5, font "standard"
-       $B!&(B $B#2Bf$N(B PentiumPro 200MHz
-       $B!&(B Primary/Backup$B!"(B $B<+F0@Z$jBX$((B
-%fore "red", size 6, font "thick"
-   $B!y(B Root-only $B%5!<%P(B
-%fore "white", size 5, font "standard"
-       $B!&(B 
-%cont, font "typewriter"
-202.12.27.33
-%font "standard"
-       $B!&(B 400 $B!A(B 500 query/sec
-%fore "red", size 6, font "thick"
-   $B!y(B $B1?MQ4IM}(B
-%fore "white", size 5, font "standard"
-       $B!&(B WIDE $B$*$h$S(B ISP $BM-;V(B
-%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
-%page
-
-%back "blue4"
-  $B$*4j$$(B
-%fore "red", size 6, font "thick"
-   $B!y(B $B:G?7$N(B root.cache $B$NF~$l49$((B
-%fore "white", size 5, font "standard"
-       $B!&(B 
-%cont, font "typewriter"
-1997082200
-%fore "red", size 6, font "thick"
-   $B!y(B Named $B$N99?7(B
-%fore "white", size 5, font "standard"
-       $B!&(B 4.9.6/8.8.1
-%fore "red", size 6, font "thick"
-   $B!y(B $BM7$P$J$$$G!'(B
-%fore "white", size 5, font "standard"
-       $B!&(B 
-%cont, font "typewriter"
-ping/traceroute
-%font "standard"
-       $B!&(B 
-%cont, font "typewriter"
-telnet/spray/...
-%fore "red", size 6, font "thick"
-   $B!y(B Thanks to
-%fore "white", size 5, font "standard"
-       $B!&(B $BF|K\(B Cisco/$BB?$/$N(B ISP
-       $B!&(B `M' $B4IM}%0%k!<%W(B
Index: kit/sample/mgp-old1.gif
Index: kit/sample/mgp-old2.gif
Index: kit/sample/mgp-old3.gif
Index: kit/sample/mgp1.gif
Index: kit/sample/mgp2.gif
Index: kit/sample/mgp3.gif
Index: kit/sample/v6header.gif
