*** dia-0.86$B$NF|K\8l2=%Q%C%A(B ***

$B$3$N%I%-%e%a%s%H$O0J2<$NFbMF$K$D$$$F=q$+$l$F$$$^$9!#(B

    $B>pJs8;(B
    $B$3$N%j%j!<%9(B (dia-0.86-7) $B$K$*$1$kJQ99E@(B
    dia-0.86$BF|K\8l2=%Q%C%A$K$D$$$F(B
    $B%$%s%9%H!<%k(B
    $BCx:n8"(B
    $BO"Mm@h(B

*** $B>pJs8;(B ***
Current Patch for dia-0.8x is at;
	master: http://www.u-aizu.ac.jp/%7Em5031201/dia/
	mirror: http://europa.u-aizu.ac.jp/%7Eyasu/dia/
(please refer;  http://www2.famille.ne.jp/~mituiwa/)

*** $B$3$N%j%j!<%9(B (dia-0.86-7) $B$K$*$1$kJQ99E@(B ***
dia-0.86-7$B$O(Bdia-0.84$B$G$NJQ99$K<c43$NJQ99$r2C$($?$b$N$G$9!#(B
$B:#2s?7$7$/DI2C$7$?5!G=$O(B

	$B!&(B(bug fix$B$r4^$^$J$$(B)$B:Y$$%3!<%I$N=$@5(B
	$B!&(BText$B%3%s%]!<%M%s%H$G$N%+!<%=%k$N>e2<0\F0$KBP1~(B
	$B!&(BEPS$B=PNO$G$N(BASCII,EUC$BJ8;z6-3&$K4^$^$l$k6uGr$N>C5n(B

*** dia-0.86$BF|K\8l2=%Q%C%A$K$D$$$F(B ***
XIM$B%5%]!<%H$O%*%j%8%J%k$K4^$^$l$F$$$^$9!#:#2s$OCf0f$5$s$,(B
gnome-devel@gnome.gr.jp$B$KEj9F$5$l$?%Q%C%A$r4^$s$G$$$^$9!#(B

$B;d$O0J2<$N8D=j$K$D$$$F%3!<%I$NJQ99!"DI2C$r9T$J$$$^$7$?!#(B
	$B!&(BEPS$B=PNO$G$N(BEUC$BBP1~(B
	$B!&(BPNG$B=PNO$G$N(BEUC$BBP1~(B
	$B!&(BText$B%3%s%]!<%M%s%H$G$N(BEUC$BBP1~(B
	$B!&(BText$B%3%s%]!<%M%s%H$G$N:o=|!"%+!<%=%k0\F0$K$*$1$k(BEUC$BBP1~(B
	$B!&%]%C%W%"%C%W%a%K%e!<4X78$N%(%i!<$KBP$9$k(B($B:,K\E*$G$J$$(B)$BBP1~(B

*** $B%$%s%9%H!<%k(B ***
tar xvzf dia-0.86.tar.gz
cd dia-0.86/
patch -p2 < dia-0.86-0-7.diff
env LINGUAS=ja ./configure
make
make install

*** $BCx:n8"(B ***
$B;d$,:n@.$7$?(Bdia-0.86$B$KBP$9$k%3!<%I$K$D$$$F$O(Bdia-0.86$B%*%j%8%J%k(B
$B$HF1MM$K(BGPL$B$N2<$G<+M3$K2~JQ!":FG[I[$,$G$-$^$9!#(B

*** $BO"Mm@h(B ***
e-mail: <yasu@dengaku.org> "Yasuhiro ABE"

# $BBg3X$N%a!<%k%"%I%l%9$OB46H;~$K$OITDL$K$J$k$N$G(B2001$BG/(B4$B7n0J9_$O(B
# yasu@dengaku.org$B$NJ}%"%I%l%9$r;H$C$F$/$@$5$$!#$=$l$^$G$O(B
# m5031201@u-aizu.ac.jp $B$b;H$($^$9!#(B

$Id: README.ja,v 1.2 2000/08/29 06:07:36 cvs Exp $


Index: dia/dia-0.86/app/display.c
diff -u dia/dia-0.86/app/display.c:1.1.1.1 dia/dia-0.86/app/display.c:1.2
--- dia/dia-0.86/app/display.c:1.1.1.1	Tue Aug  8 15:12:47 2000
+++ dia/dia-0.86/app/display.c	Thu Aug 10 16:41:25 2000
@@ -155,9 +155,6 @@
   g_hash_table_insert (display_ht, ddisp->shell, ddisp);
   g_hash_table_insert (display_ht, ddisp->canvas, ddisp);
 
-  ddisp->ic = NULL;
-  ddisp->ic_attr = NULL;
-
   return ddisp;  /*  set the user data  */
 }
 
Index: dia/dia-0.86/app/menus.c
diff -u dia/dia-0.86/app/menus.c:1.1.1.1 dia/dia-0.86/app/menus.c:1.2
--- dia/dia-0.86/app/menus.c:1.1.1.1	Tue Aug  8 15:12:48 2000
+++ dia/dia-0.86/app/menus.c	Tue Aug 29 15:07:20 2000
@@ -500,7 +500,11 @@
   g_string_append(path, _("/Tools/"));
   len = path->len;
   for (i = 0; i < num_tools; i++) {
+#ifdef USE_XIM
+    g_string_append(path, gettext(tool_data[i].menuitem_name));
+#else
     g_string_append(path, tool_data[i].menuitem_name);
+#endif
     menuitem = menus_get_item_from_path(path->str);
     if (menuitem != NULL)
       gtk_signal_connect(GTK_OBJECT(menuitem), "activate",
Index: dia/dia-0.86/app/render_eps.c
diff -u dia/dia-0.86/app/render_eps.c:1.1.1.1 dia/dia-0.86/app/render_eps.c:1.5
--- dia/dia-0.86/app/render_eps.c:1.1.1.1	Tue Aug  8 15:12:49 2000
+++ dia/dia-0.86/app/render_eps.c	Mon Aug 28 13:47:35 2000
@@ -27,6 +27,13 @@
 #include "message.h"
 #include "diagramdata.h"
 
+#ifdef USE_XIM
+void local_draw_string(RendererEPS *renderer,
+		       const char *text,
+		       Point *pos, Alignment alignment,
+		       Color *color);
+#endif
+
 static void begin_render(RendererEPS *renderer, DiagramData *data);
 static void end_render(RendererEPS *renderer);
 static void set_linewidth(RendererEPS *renderer, real linewidth);
@@ -719,9 +726,15 @@
 static void
 set_font(RendererEPS *renderer, Font *font, real height)
 {
+#ifdef USE_XIM
+  /* keep properties into renderer object */
+  renderer->font = font;
+  renderer->font_height = height;
+#else
 
   fprintf(renderer->file, "/%s-latin1 ff %f scf sf\n",
 	  font_get_psfontname(font), (double)height);
+#endif
 }
 
 static void
@@ -965,11 +978,74 @@
   fprintf(renderer->file, " f\n");
 }
 
+#ifdef USE_XIM
+static void
+draw_string(RendererEPS *renderer,
+	    const char *text,
+	    Point *pos, Alignment alignment,
+	    Color *color)
+{
+  Point _pos;
+  int i;
+  int s;
+  char *buff;
+
+  _pos = *pos;
+  if(alignment == ALIGN_RIGHT) {
+    _pos.x -= font_string_width(text, renderer->font, renderer->font_height);
+    alignment = ALIGN_LEFT;
+  } else if (alignment == ALIGN_CENTER) {
+    _pos.x -= font_string_width(text, renderer->font, renderer->font_height) / 2;
+    alignment = ALIGN_LEFT;
+  }
+  buff = (char *)g_malloc0(sizeof(char) * strlen(text) + 1);
+  for(i=1, s=1; i<strlen(text); i++,s++) {
+    if (text[i-1] * text[i] < 0) { /* when finding the boundary */
+      if (text[i-1] > 0) {
+ 	/* printing ASCII chars */
+	fprintf(renderer->file, "/%s-latin1 ff %f scf sf\n", font_get_psfontname(renderer->font), (double)renderer->font_height);
+      } else {
+ 	/* printging 16bits chars */
+	fprintf(renderer->file, "/%s-EUC-H ff %f scf sf\n", font_get_mbpsfontname(renderer->font), (double)renderer->font_height);
+      }
+      strncpy(buff, &text[i-s], s);
+      buff[s] = '\0';
+      s = 0;
+      local_draw_string(renderer,
+			buff,
+			&_pos, alignment,
+			color);
+      _pos.x += font_string_width(buff, renderer->font, renderer->font_height);
+    }
+  }
+  if (text[i-1] > 0) {
+    /* printing ASCII chars */
+    fprintf(renderer->file, "/%s-latin1 ff %f scf sf\n", font_get_psfontname(renderer->font), (double)renderer->font_height);
+  } else {
+    /* printging 16bits chars */
+    fprintf(renderer->file, "/%s-EUC-H ff %f scf sf\n", font_get_mbpsfontname(renderer->font), (double)renderer->font_height);
+  }
+  strncpy(buff, &text[i-s], s);
+  buff[s] = '\0';
+  local_draw_string(renderer,
+		    buff,
+		    &_pos, alignment,
+		    color);
+  g_free(buff);
+}
+
+void
+local_draw_string(RendererEPS *renderer,
+	    const char *text,
+	    Point *pos, Alignment alignment,
+	    Color *color)
+#else
 static void
 draw_string(RendererEPS *renderer,
 	    const char *text,
 	    Point *pos, Alignment alignment,
 	    Color *color)
+#endif
 {
   char *buffer;
   const char *str;
Index: dia/dia-0.86/app/render_eps.h
diff -u dia/dia-0.86/app/render_eps.h:1.1.1.1 dia/dia-0.86/app/render_eps.h:1.2
--- dia/dia-0.86/app/render_eps.h:1.1.1.1	Tue Aug  8 15:12:49 2000
+++ dia/dia-0.86/app/render_eps.h	Sat Aug 26 21:42:42 2000
@@ -37,6 +37,10 @@
   LineStyle saved_line_style;
   real dash_length;
   real dot_length;
+#ifdef USE_XIM
+  Font *font;
+  real font_height;
+#endif
 };
 
 RendererEPS *new_eps_renderer(Diagram *dia, char *filename);
Index: dia/dia-0.86/app/render_libart.c
diff -u dia/dia-0.86/app/render_libart.c:1.1.1.1 dia/dia-0.86/app/render_libart.c:1.3
--- dia/dia-0.86/app/render_libart.c:1.1.1.1	Tue Aug  8 15:12:49 2000
+++ dia/dia-0.86/app/render_libart.c	Tue Aug 29 15:07:02 2000
@@ -1107,6 +1107,91 @@
   art_svp_free( svp );
 }
 
+#ifdef USE_XIM
+SuckFont *
+get_suck_font (GdkFont *font, guchar *sentence)
+{
+  SuckFont *suckfont;
+  int x, y;
+  int lbearing, rbearing, ch_width, ascent, descent;
+  GdkPixmap *pixmap;
+  GdkColor black, white;
+  GdkImage *image;
+  GdkGC *gc;
+  guchar *line;
+  int width, height;
+  int black_pixel, pixel;
+
+  if (!font)
+    return NULL;
+
+  suckfont = g_new (SuckFont, 1);
+
+  height = font->ascent + font->descent;
+  x = 0;
+  gdk_string_extents(font, sentence,
+		     &lbearing, &rbearing, &ch_width, &ascent, &descent);
+  suckfont->chars[0].left_sb = lbearing;
+  suckfont->chars[0].right_sb = ch_width - rbearing;
+  suckfont->chars[0].width = rbearing - lbearing;
+  suckfont->chars[0].ascent = ascent;
+  suckfont->chars[0].descent = descent;
+  suckfont->chars[0].bitmap_offset = x;
+  x += (ch_width + 31) & -32;
+  width = x;
+
+  suckfont->bitmap_width = width;
+  suckfont->bitmap_height = height+1;
+  suckfont->ascent = font->ascent+1;
+
+  pixmap = gdk_pixmap_new (NULL, suckfont->bitmap_width,
+			   suckfont->bitmap_height, 1);
+  gc = gdk_gc_new (pixmap);
+  gdk_gc_set_font (gc, font);
+
+  black_pixel = color_gdk_black.pixel;
+  black.pixel = black_pixel;
+  white.pixel = color_gdk_white.pixel;
+  gdk_gc_set_foreground (gc, &white);
+  gdk_draw_rectangle (pixmap, gc, 1, 0, 0, suckfont->bitmap_width, suckfont->bitmap_height);
+
+  gdk_gc_set_foreground (gc, &black);
+
+  gdk_draw_string (pixmap, font, gc,
+		   suckfont->chars[0].bitmap_offset - suckfont->chars[0].left_sb,
+		   font->ascent+1,
+		   sentence);
+
+  /* The handling of the image leaves me with distinct unease.  But this
+   * is more or less copied out of gimp/app/text_tool.c, so it _ought_ to
+   * work. -RLL
+   */
+
+  image = gdk_image_get (pixmap, 0, 0, suckfont->bitmap_width, suckfont->bitmap_height);
+  suckfont->bitmap = g_malloc0 ((width >> 3) * suckfont->bitmap_height);
+
+  line = suckfont->bitmap;
+  for (y = 0; y < suckfont->bitmap_height; y++) {
+    for (x = 0; x < suckfont->bitmap_width; x++) {
+      pixel = gdk_image_get_pixel (image, x, y);
+      if (pixel == black_pixel)
+	line[x >> 3] |= 128 >> (x & 7);
+    }
+    line += width >> 3;
+  }
+
+  gdk_image_destroy (image);
+
+  /* free the pixmap */
+  gdk_pixmap_unref (pixmap);
+
+  /* free the gc */
+  gdk_gc_destroy (gc);
+
+  return suckfont;
+}
+#endif
+
 static void
 draw_string(RendererLibart *renderer,
 	    const char *text,
@@ -1137,7 +1222,11 @@
     break;
   }
 
+#ifdef USE_XIM
+  suckfont = get_suck_font(renderer->gdk_font, text);
+#else
   suckfont = renderer->suck_font;
+#endif
 
   xpos = (double) x + 1; 
   ypos = (double) (y - suckfont->ascent);
@@ -1145,6 +1234,25 @@
   rgba = color_to_rgba(color);
   
   len = strlen(text);
+#ifdef USE_XIM
+  {
+    SuckChar *ch;
+    ch = &suckfont->chars[0];
+    art_affine_translate(affine, xpos, ypos);
+    art_rgb_bitmap_affine(renderer->rgb_buffer,
+			  0, 0,
+			  renderer->renderer.pixel_width,
+			  renderer->renderer.pixel_height,
+			  renderer->renderer.pixel_width*3,
+			  suckfont->bitmap + (ch->bitmap_offset >> 3),
+			  ch->width,
+			  suckfont->bitmap_height,
+			  suckfont->bitmap_width >> 3,
+			  rgba,
+			  affine,
+			  ART_FILTER_NEAREST, NULL);
+  }
+#else
   for (i = 0; i < len; i++) {
     SuckChar *ch;
     
@@ -1166,7 +1274,7 @@
     dx = ch->left_sb + ch->width + ch->right_sb;
     xpos += dx;
   }
-
+#endif
   
   
 }
Index: dia/dia-0.86/lib/font.c
diff -u dia/dia-0.86/lib/font.c:1.1.1.1 dia/dia-0.86/lib/font.c:1.14
--- dia/dia-0.86/lib/font.c:1.1.1.1	Tue Aug  8 15:12:15 2000
+++ dia/dia-0.86/lib/font.c	Tue Aug 29 15:06:14 2000
@@ -60,6 +60,10 @@
 
 #define NUM_X11_FONTS 2
 
+#ifdef USE_XIM
+#define NUM_PS_FONTS 2
+#endif
+
 typedef struct _FontPrivate FontPrivate;
 typedef struct  _FontCacheItem FontCacheItem;
 
@@ -73,7 +77,11 @@
   Font public;
   char *fontname_x11;
   char **fontname_x11_vec;
+#ifdef USE_XIM
+  char *fontname_ps[NUM_PS_FONTS];
+#else
   char *fontname_ps;
+#endif
   FontCacheItem *cache[FONTCACHE_SIZE];
   real ascent_ratio, descent_ratio;
 };
@@ -81,12 +89,260 @@
 
 typedef struct _FontData {
   char *fontname;
+#ifdef USE_XIM
+  char *fontname_ps[NUM_PS_FONTS];
+#else
   char *fontname_ps;
+#endif
   char *fontname_x11[NUM_X11_FONTS]; /* First choice */
 } FontData;
 
 FontData font_data[] = {
+#ifdef USE_XIM
   { "Times-Roman",
+    { "Times-Roman", "Ryumin-Light" },
+    { "-adobe-times-medium-r-normal-*-%d-*-*-*-*-*-*-*,-misc-*-medium-r-normal-*-%d-*-*-*-*-*-jisx0208.1983-0",
+      NULL
+    }
+  }, 
+  { "Times-Italic",
+    { "Times-Italic", "Ryumin-Light" },
+    { "-adobe-times-medium-i-normal-*-%d-*-*-*-*-*-*-*,-misc-*-medium-r-normal-*-%d-*-*-*-*-*-jisx0208.1983-0",
+      NULL
+    }
+  }, 
+  { "Times-Bold",
+    { "Times-Bold", "GothicBBB-Medium" },
+    { "-adobe-times-bold-r-normal-*-%d-*-*-*-*-*-*-*,-misc-*-medium-r-bold-*-%d-*-*-*-*-*-jisx0208.1983-0",
+      NULL
+    }
+  }, 
+  { "Times-BoldItalic",
+    { "Times-BoldItalic", "GothicBBB-Medium" },
+    { "-adobe-times-bold-i-normal-*-%d-*-*-*-*-*-*-*,-misc-*-medium-r-bold-*-%d-*-*-*-*-*-jisx0208.1983-0",
+      NULL
+    }
+  }, 
+  { "AvantGarde-Book",
+    { "AvantGarde-Book", "Ryumin-Light" },
+    { "-adobe-avantgarde-book-r-normal-*-%d-*-*-*-*-*-*-*,-misc-*-medium-r-normal-*-%d-*-*-*-*-*-jisx0208.1983-0",
+      "-schumacher-clean-medium-r-normal-*-%d-*-*-*-*-*-*-*"
+    }
+  },
+  { "AvantGarde-BookOblique",
+    { "AvantGarde-BookOblique", "Ryumin-Light" },
+    { "-adobe-avantgarde-book-o-normal-*-%d-*-*-*-*-*-*-*,-misc-*-medium-r-normal-*-%d-*-*-*-*-*-jisx0208.1983-0",
+      "-schumacher-clean-medium-i-normal-*-%d-*-*-*-*-*-*-*"
+    }
+  },
+  { "AvantGarde-Demi",
+    { "AvantGarde-Demi", "GothicBBB-Medium" },
+    { "-adobe-avantgarde-demibold-r-normal-*-%d-*-*-*-*-*-*-*,-misc-*-bold-r-normal-*-%d-*-*-*-*-*-jisx0208.1983-0",
+      "-schumacher-clean-bold-r-normal-*-%d-*-*-*-*-*-*-*"
+    }
+  },
+  { "AvantGarde-DemiOblique",
+    { "AvantGarde-DemiOblique", "GothicBBB-Medium" },
+    { "-adobe-avantgarde-demibold-o-normal-*-%d-*-*-*-*-*-*-*,-misc-*-bold-r-normal-*-%d-*-*-*-*-*-jisx0208.1983-0",
+      "-schumacher-clean-bold-i-normal-*-%d-*-*-*-*-*-*-*"
+    }
+  },
+  { "Bookman-Light",
+    { "Bookman-Light", "Ryumin-Light" },
+    { "-adobe-bookman-light-r-normal-*-%d-*-*-*-*-*-*-*,-misc-*-medium-r-normal-*-%d-*-*-*-*-*-jisx0208.1983-0",
+      "-adobe-times-medium-r-normal-*-%d-*-*-*-*-*-*-*"
+    }
+  },
+  { "Bookman-LightItalic",
+    { "Bookman-LightItalic", "Ryumin-Light" },
+    { "-adobe-bookman-light-i-normal-*-%d-*-*-*-*-*-*-*,-misc-*-medium-r-normal-*-%d-*-*-*-*-*-jisx0208.1983-0",
+      "-adobe-times-medium-i-normal-*-%d-*-*-*-*-*-*-*"
+    }
+  },
+  { "Bookman-Demi",
+    { "Bookman-Demi", "GothicBBB-Medium" },
+    { "-adobe-bookman-demibold-r-normal-*-%d-*-*-*-*-*-*-*,-misc-*-bold-r-normal-*-%d-*-*-*-*-*-jisx0208.1983-0",
+      "-adobe-times-bold-r-normal-*-%d-*-*-*-*-*-*-*"
+    }
+  },
+  { "Bookman-DemiItalic",
+    { "Bookman-DemiItalic", "GothicBBB-Medium" },
+    { "-adobe-bookman-demibold-i-normal-*-%d-*-*-*-*-*-*-*,-misc-*-bold-r-normal-*-%d-*-*-*-*-*-jisx0208.1983-0",
+      "-adobe-times-bold-i-normal-*-%d-*-*-*-*-*-*-*"
+    }
+  },
+#ifndef G_OS_WIN32
+  { "Courier",
+    { "Courier", "Ryumin-Light" },
+    { "-adobe-courier-medium-r-normal-*-%d-*-*-*-*-*-*-*,-misc-*-medium-r-normal-*-%d-*-*-*-*-*-jisx0208.1983-0",
+      NULL
+    }
+  },
+  { "Courier-Oblique",
+    { "Courier-Oblique", "Ryumin-Light" },
+    { "-adobe-courier-medium-o-normal-*-%d-*-*-*-*-*-*-*,-misc-*-medium-r-normal-*-%d-*-*-*-*-*-jisx0208.1983-0",
+      NULL
+    }
+  },
+  { "Courier-Bold",
+    { "Courier-Bold", "GothicBBB-Medium" },
+    { "-adobe-courier-bold-r-normal-*-%d-*-*-*-*-*-*-*,-misc-*-bold-r-normal-*-%d-*-*-*-*-*-jisx0208.1983-0",
+      NULL
+    }
+  },
+  { "Courier-BoldOblique",
+    { "Courier-BoldOblique", "GothicBBB-Medium" },
+    { "-adobe-courier-bold-o-normal-*-%d-*-*-*-*-*-*-*,-misc-*-bold-r-normal-*-%d-*-*-*-*-*-jisx0208.1983-0",
+      NULL
+    }
+  },
+#else /* G_OS_WIN32 */
+  /* HB: force usage of true type font "Courier New", using the bitmap
+   * version causes scaling problems mainly with uml. FIXME: there
+   * must be a better way to do this ?
+   */
+  { "Courier",
+    "Courier",
+    { "-adobe-courier new-medium-r-normal-*-%d-*-*-*-*-*-*-*",
+      NULL
+    }
+  },
+  { "Courier-Oblique",
+    "Courier-Oblique",
+    { "-adobe-courier new-medium-o-normal-*-%d-*-*-*-*-*-*-*",
+      NULL
+    }
+  },
+  { "Courier-Bold",
+    "Courier-Bold",
+    { "-adobe-courier new-bold-r-normal-*-%d-*-*-*-*-*-*-*",
+      NULL
+    }
+  },
+  { "Courier-BoldOblique",
+    "Courier-BoldOblique",
+    { "-adobe-courier new-bold-o-normal-*-%d-*-*-*-*-*-*-*",
+      NULL
+    }
+  },
+#endif
+  { "Helvetica",
+    { "Helvetica", "Ryumin-Light" },
+    { "-adobe-helvetica-medium-r-normal-*-%d-*-*-*-*-*-*-*,-misc-*-medium-r-normal-*-%d-*-*-*-*-*-jisx0208.1983-0",
+      NULL
+    }
+  },
+  { "Helvetica-Oblique",
+    { "Helvetica-Oblique", "Ryumin-Light" },
+    { "-adobe-helvetica-medium-o-normal-*-%d-*-*-*-*-*-*-*,-misc-*-medium-r-normal-*-%d-*-*-*-*-*-jisx0208.1983-0",
+      NULL
+    }
+  },
+  { "Helvetica-Bold",
+    { "Helvetica-Bold", "GothicBBB-Medium" },
+    { "-adobe-helvetica-bold-r-normal-*-%d-*-*-*-*-*-*-*,-misc-*-bold-r-normal-*-%d-*-*-*-*-*-jisx0208.1983-0",
+      NULL
+    }
+  },
+  { "Helvetica-BoldOblique",
+    { "Helvetica-BoldOblique", "GothicBBB-Medium" },
+    { "-adobe-helvetica-bold-o-normal-*-%d-*-*-*-*-*-*-*,-misc-*-bold-r-normal-*-%d-*-*-*-*-*-jisx0208.1983-0",
+      NULL
+    }
+  },
+  { "Helvetica-Narrow",
+    { "Helvetica-Narrow", "Ryumin-Light" },
+    { "-adobe-helvetica-medium-r-normal-*-%d-*-*-*-*-*-*-*,-misc-*-medium-r-normal-*-%d-*-*-*-*-*-jisx0208.1983-0",
+      NULL
+    }
+  },
+  { "Helvetica-Narrow-Oblique",
+    { "Helvetica-Narrow-Oblique", "Ryumin-Light" },
+    { "-adobe-helvetica-medium-o-normal-*-%d-*-*-*-*-*-*-*,-misc-*-medium-r-normal-*-%d-*-*-*-*-*-jisx0208.1983-0",
+      NULL
+    }
+  },
+  { "Helvetica-Narrow-Bold",
+    { "Helvetica-Narrow-Bold", "GothicBBB-Medium" },
+    { "-adobe-helvetica-bold-r-normal-*-%d-*-*-*-*-*-*-*,-misc-*-bold-r-normal-*-%d-*-*-*-*-*-jisx0208.1983-0",
+      NULL
+    }
+  },
+  { "Helvetica-Narrow-BoldOblique",
+    { "Helvetica-Narrow-BoldOblique", "GothicBBB-Medium" },
+    { "-adobe-helvetica-bold-o-normal-*-%d-*-*-*-*-*-*-*,-misc-*-bold-r-normal-*-%d-*-*-*-*-*-jisx0208.1983-0",
+      NULL
+    }
+  },
+  { "NewCenturySchoolbook-Roman",
+    { "NewCenturySchlbk-Roman", "Ryumin-Light" },
+    { "-adobe-new century schoolbook-medium-r-normal-*-%d-*-*-*-*-*-*-*,-misc-*-medium-r-normal-*-%d-*-*-*-*-*-jisx0208.1983-0",
+      NULL
+    }
+  },
+  { "NewCenturySchoolbook-Italic",
+    { "NewCenturySchlbk-Italic", "Ryumin-Light" },
+    { "-adobe-new century schoolbook-medium-i-normal-*-%d-*-*-*-*-*-*-*,-misc-*-medium-r-normal-*-%d-*-*-*-*-*-jisx0208.1983-0",
+      NULL
+    }
+  },
+  { "NewCenturySchoolbook-Bold",
+    { "NewCenturySchlbk-Bold", "GothicBBB-Medium" },
+    { "-adobe-new century schoolbook-bold-r-normal-*-%d-*-*-*-*-*-*-*,-misc-*-bold-r-normal-*-%d-*-*-*-*-*-jisx0208.1983-0",
+      NULL
+    }
+  },
+  { "NewCenturySchoolbook-BoldItalic",
+    { "NewCenturySchlbk-BoldItalic", "GothicBBB-Medium" },
+    { "-adobe-new century schoolbook-bold-i-normal-*-%d-*-*-*-*-*-*-*,-misc-*-bold-r-normal-*-%d-*-*-*-*-*-jisx0208.1983-0",
+      NULL
+    }
+  },
+  { "Palatino-Roman",
+    { "Palatino-Roman", "Ryumin-Light" },
+    { "-adobe-palatino-medium-r-normal-*-%d-*-*-*-*-*-*-*,-misc-*-medium-r-normal-*-%d-*-*-*-*-*-jisx0208.1983-0",
+      "-*-lucidabright-medium-r-normal-*-%d-*-*-*-*-*-*-*"
+    }
+  },
+  { "Palatino-Italic",
+    { "Palatino-Italic", "Ryumin-Light" },
+    { "-adobe-palatino-medium-i-normal-*-%d-*-*-*-*-*-*-*,-misc-*-medium-r-normal-*-%d-*-*-*-*-*-jisx0208.1983-0",
+      "-*-lucidabright-medium-i-normal-*-%d-*-*-*-*-*-*-*"
+    }
+  },
+  { "Palatino-Bold",
+    { "Palatino-Bold", "GothicBBB-Medium" },
+    { "-adobe-palatino-bold-r-normal-*-%d-*-*-*-*-*-*-*,-misc-*-bold-r-normal-*-%d-*-*-*-*-*-jisx0208.1983-0",
+      "-*-lucidabright-demibold-r-normal-*-%d-*-*-*-*-*-*-*"
+    }
+  },
+  { "Palatino-BoldItalic",
+    { "Palatino-BoldItalic", "GothicBBB-Medium" },
+    { "-adobe-palatino-bold-i-normal-*-%d-*-*-*-*-*-*-*,-misc-*-bold-r-normal-*-%d-*-*-*-*-*-jisx0208.1983-0",
+      "-*-lucidabright-demibold-i-normal-*-%d-*-*-*-*-*-*-*"
+    }
+  },
+  { "Symbol",
+    { "Symbol", "Ryumin-Light" },
+    {
+      "-adobe-symbol-medium-r-normal-*-%d-*-*-*-*-*-*-*,-misc-*-medium-r-normal-*-%d-*-*-*-*-*-jisx0208.1983-0",
+      "-*-symbol-medium-r-normal-*-%d-*-*-*-*-*-*-*"
+    }
+  },
+  { "ZapfChancery-MediumItalic",
+    { "ZapfChancery-MediumItalic", "Ryumin-Light" },
+    { "-adobe-zapf chancery-medium-i-normal-*-%d-*-*-*-*-*-*-*,-misc-*-medium-r-normal-*-%d-*-*-*-*-*-jisx0208.1983-0",
+      "-*-itc zapf chancery-medium-i-normal-*-%d-*-*-*-*-*-*-*"
+    }
+  },
+  { "ZapfDingbats",
+    { "ZapfDingbats", "Ryumin-Light" },
+    { "-adobe-zapf dingbats-medium-r-normal-*-%d-*-*-*-*-*-*-*,-misc-*-medium-r-normal-*-%d-*-*-*-*-*-jisx0208.1983-0",
+      "-*-itc zapf dingbats-*-*-*-*-%d-*-*-*-*-*-*-*"
+    }
+  },
+#else
+  { "Times-Roman",
     "Times-Roman",
     { "-adobe-times-medium-r-normal-*-%d-*-*-*-*-*-*-*",
       NULL
@@ -328,6 +584,7 @@
       "-*-itc zapf dingbats-*-*-*-*-%d-*-*-*-*-*-*-*"
     }
   },
+#endif
 };
 
 #define NUM_FONTS (sizeof(font_data)/sizeof(FontData))
@@ -337,7 +594,7 @@
 GHashTable *fonts_hash = NULL;
 
 char *last_resort_fonts[] = {
-  "-adobe-courier-medium-r-normal-*-%d-*-*-*-*-*-*-*",
+  "-alias-*-medium-r-normal-*-%d-*-*-*-*-*-*-*",
   "fixed" /* Must be last. This is guaranteed to exist on an X11 system. */
 };
 #define NUM_LAST_RESORT_FONTS (sizeof(last_resort_fonts)/sizeof(char *))
@@ -359,11 +616,16 @@
     x11_font = font->fontname_x11_vec[i];
     if (x11_font == NULL)
       break;
-    bufsize = strlen(x11_font)+6;  /* Should be enought*/
+    bufsize = strlen(x11_font)+12;  /* Should be enought*/
     buffer = (char *)g_malloc(bufsize);
+
+#ifdef USE_XIM
+    g_snprintf(buffer, bufsize, x11_font, 100, 100);
+    gdk_font = gdk_fontset_load(buffer);
+#else
     g_snprintf(buffer, bufsize, x11_font, 100);
-    
     gdk_font = gdk_font_load(buffer);
+#endif
     if (gdk_font!=NULL) {
       font->fontname_x11 = x11_font;
     }
@@ -376,11 +638,16 @@
   if (font->fontname_x11 == NULL) {
     for (i=0;i<NUM_LAST_RESORT_FONTS;i++) {
       x11_font = last_resort_fonts[i];
-      bufsize = strlen(x11_font)+6;  /* Should be enought*/
+      bufsize = strlen(x11_font)+12;  /* Should be enought*/
       buffer = (char *)g_malloc(bufsize);
+
+#ifdef USE_XIM
+      g_snprintf(buffer, bufsize, x11_font, 100, 100);
+      gdk_font = gdk_fontset_load(buffer);
+#else
       g_snprintf(buffer, bufsize, x11_font, 100);
-      
       gdk_font = gdk_font_load(buffer);
+#endif
       g_free(buffer);
       if (gdk_font!=NULL) {
 	message_warning(_("Warning no X Font for %s found, \nusing %s instead.\n"), font->public.name, x11_font);
@@ -409,7 +676,13 @@
   for (i=0;i<NUM_FONTS;i++) {
     font = g_new(FontPrivate, 1);
     font->public.name = font_data[i].fontname;
+#ifdef USE_XIM
+    for(j=0;j<NUM_PS_FONTS;j++) {
+      font->fontname_ps[j] = font_data[i].fontname_ps[j];
+    }
+#else
     font->fontname_ps = font_data[i].fontname_ps;
+#endif
 
     font->fontname_x11 = NULL;
     font->fontname_x11_vec = font_data[i].fontname_x11;
@@ -480,10 +753,15 @@
   char *buffer;
   GdkFont *gdk_font;
   
-  bufsize = strlen(font->fontname_x11)+6;  /* Should be enought*/
+  bufsize = strlen(font->fontname_x11)+12;  /* Should be enought*/
   buffer = (char *)malloc(bufsize);
+#ifdef USE_XIM
+  g_snprintf(buffer, bufsize, font->fontname_x11, height, height);
+  gdk_font = gdk_fontset_load(buffer);
+#else
   g_snprintf(buffer, bufsize, font->fontname_x11, height);
   gdk_font = gdk_font_load(buffer);
+#endif
   free(buffer);
 
   return gdk_font;
@@ -533,6 +811,27 @@
   return cache_item->suck_font;
 }
 
+#ifdef USE_XIM
+char *
+font_get_mbpsfontname(Font *font)
+{
+  FontPrivate *fontprivate;
+
+  fontprivate = (FontPrivate *)font;
+  
+  return fontprivate->fontname_ps[1];
+}
+
+char *
+font_get_psfontname(Font *font)
+{
+  FontPrivate *fontprivate;
+
+  fontprivate = (FontPrivate *)font;
+  
+  return fontprivate->fontname_ps[0];
+}
+#else
 char *
 font_get_psfontname(Font *font)
 {
@@ -542,6 +841,7 @@
   
   return fontprivate->fontname_ps;
 }
+#endif
 
 real
 font_string_width(const char *string, Font *font, real height)
@@ -558,10 +858,18 @@
 
   if ((iwidth==0) || (iheight==0))
     return 0.0;
-  
+
+#ifdef USE_XIM  
+  width_height = ((real)iwidth)/((real)iheight);
+
+  return width_height*height*(iheight/100.0);
+#else
   width_height = ((real)iwidth)/((real)iheight);
-  width_height *= 1.01;
-  return width_height*height*(iheight/100.0) + 0.2;
+  width_height *= 1.01; /* 1.01 included boundary width */
+
+  return width_height*height*(iheight/100.0) + 0.2; /* 0.2 is boundary width */
+#endif
+  
 }
 
 real
Index: dia/dia-0.86/lib/font.h
diff -u dia/dia-0.86/lib/font.h:1.1.1.1 dia/dia-0.86/lib/font.h:1.2
--- dia/dia-0.86/lib/font.h:1.1.1.1	Tue Aug  8 15:12:15 2000
+++ dia/dia-0.86/lib/font.h	Sat Aug 26 21:42:42 2000
@@ -60,6 +60,9 @@
 GdkFont *font_get_gdkfont(Font *font, int height);
 SuckFont *font_get_suckfont(Font *font, int height);
 char *font_get_psfontname(Font *font);
+#ifdef USE_XIM
+extern char *font_get_mbpsfontname(Font *font);
+#endif
 real font_string_width(const char *string, Font *font, real height);
 real font_ascent(Font *font, real height);
 real font_descent(Font *font, real height);
Index: dia/dia-0.86/lib/text.c
diff -u dia/dia-0.86/lib/text.c:1.1.1.1 dia/dia-0.86/lib/text.c:1.2
--- dia/dia-0.86/lib/text.c:1.1.1.1	Tue Aug  8 15:12:15 2000
+++ dia/dia-0.86/lib/text.c	Sat Aug 26 15:39:13 2000
@@ -507,6 +507,11 @@
     } else {
       return;
     }
+#ifdef USE_XIM
+    if(text->line[row][i]<0) {
+      i++;
+    }
+#endif
   }
   text->cursor_pos = text->strlen[row];
 }
@@ -577,11 +582,27 @@
       text_join_lines(text, row);
     return;
   }
+#ifdef USE_XIM
+  if(text->line[row][text->cursor_pos] > 0) {
+    memmove(text->line[row] + text->cursor_pos,
+           text->line[row] + text->cursor_pos + 1,
+           text->strlen[row] - text->cursor_pos);
+
+    text->strlen[row]--;
+  } else {
+    memmove(text->line[row] + text->cursor_pos,
+            text->line[row] + text->cursor_pos + 2,
+            text->strlen[row] - text->cursor_pos - 1);
+
+    text->strlen[row]-=2;
+  }
+#else
   memmove(text->line[row] + text->cursor_pos,
 	  text->line[row] + text->cursor_pos + 1,
 	  text->strlen[row] - text->cursor_pos);
 
   text->strlen[row]--;
+#endif
   
   if (text->cursor_pos > text->strlen[text->cursor_row])
     text->cursor_pos = text->strlen[text->cursor_row];
@@ -608,6 +629,22 @@
       text_join_lines(text, row-1);
     return;
   }
+#ifdef USE_XIM
+  if(text->line[row][text->cursor_pos-1] > 0) {
+    memmove(text->line[row] + text->cursor_pos - 1,
+            text->line[row] + text->cursor_pos,
+            text->strlen[row] - text->cursor_pos + 1);
+    text->strlen[row]--;
+    
+    text->cursor_pos --;
+  } else {
+    memmove(text->line[row] + text->cursor_pos - 2,
+            text->line[row] + text->cursor_pos,
+            text->strlen[row] - text->cursor_pos + 2);
+    text->strlen[row]-=2;
+    text->cursor_pos -=2;
+  }
+#else
   memmove(text->line[row] + text->cursor_pos - 1,
 	  text->line[row] + text->cursor_pos,
 	  text->strlen[row] - text->cursor_pos + 1);
@@ -615,6 +652,7 @@
   text->strlen[row]--;
 
   text->cursor_pos --;
+#endif
   
   if (text->cursor_pos > text->strlen[text->cursor_row])
     text->cursor_pos = text->strlen[text->cursor_row];
@@ -738,6 +776,18 @@
     if (text->cursor_pos > text->strlen[text->cursor_row])
       text->cursor_pos = text->strlen[text->cursor_row];
 
+#ifdef USE_XIM
+    {
+      int i = 0;
+      while(i < text->cursor_pos) {
+	if ( text->line[text->cursor_row][i] < 0 )
+	  i+=2;
+	else
+	  i++;
+      }
+      text->cursor_pos = i;
+    }
+#endif
     break;
   case GDK_Down:
     text->cursor_row++;
@@ -747,14 +797,42 @@
     if (text->cursor_pos > text->strlen[text->cursor_row])
       text->cursor_pos = text->strlen[text->cursor_row];
     
+#ifdef USE_XIM
+    {
+      int i = 0;
+      while(i < text->cursor_pos) {
+	if ( text->line[text->cursor_row][i] < 0 )
+	  i+=2;
+	else
+	  i++;
+      }
+      text->cursor_pos = i;
+    }
+#endif
     break;
   case GDK_Left:
+#ifdef USE_XIM
+    if(text->line[text->cursor_row][text->cursor_pos-1] > 0) {
+      text->cursor_pos--;
+    } else {
+      text->cursor_pos-=2;
+    }
+#else
     text->cursor_pos--;
+#endif
     if (text->cursor_pos<0)
       text->cursor_pos = 0;
     break;
   case GDK_Right:
+#ifdef USE_XIM
+    if(text->line[text->cursor_row][text->cursor_pos+1] > 0) {
+      text->cursor_pos++;
+    } else {
+      text->cursor_pos+=2;
+    }
+#else
     text->cursor_pos++;
+#endif
     if (text->cursor_pos > text->strlen[text->cursor_row])
       text->cursor_pos = text->strlen[text->cursor_row];
     break;
Index: dia/dia-0.86/objects/UML/class.c
diff -u dia/dia-0.86/objects/UML/class.c:1.1.1.1 dia/dia-0.86/objects/UML/class.c:1.2
--- dia/dia-0.86/objects/UML/class.c:1.1.1.1	Tue Aug  8 15:12:22 2000
+++ dia/dia-0.86/objects/UML/class.c	Sun Aug 27 19:06:33 2000
@@ -428,17 +428,28 @@
   }
   if (umlclass->stereotype != NULL) {
     umlclass->namebox_height += font_height;
+#ifdef USE_XIM
     umlclass->stereotype_string =
+      g_malloc(sizeof(char)*(strlen(umlclass->stereotype)+4+1));
+
+    strcpy(umlclass->stereotype_string, UML_STEREOTYPE_START);
+#else
+    umlclass->stereotype_string =
       g_malloc(sizeof(char)*(strlen(umlclass->stereotype)+2+1));
-    
+
     umlclass->stereotype_string[0] = UML_STEREOTYPE_START;
     umlclass->stereotype_string[1] = 0;
+#endif
     
     strcat(umlclass->stereotype_string, umlclass->stereotype);
 
+#ifdef USE_XIM
+    strcat(umlclass->stereotype_string,UML_STEREOTYPE_END);
+#else
     i = strlen(umlclass->stereotype_string);
     umlclass->stereotype_string[i] = UML_STEREOTYPE_END;
     umlclass->stereotype_string[i+1] = 0;
+#endif
 
     width = font_string_width(umlclass->stereotype_string, umlclass->normal_font, font_height);
     maxwidth = MAX(width, maxwidth);
Index: dia/dia-0.86/objects/UML/uml.h
diff -u dia/dia-0.86/objects/UML/uml.h:1.1.1.1 dia/dia-0.86/objects/UML/uml.h:1.2
--- dia/dia-0.86/objects/UML/uml.h:1.1.1.1	Tue Aug  8 15:12:22 2000
+++ dia/dia-0.86/objects/UML/uml.h	Sun Aug 27 19:06:33 2000
@@ -77,8 +77,13 @@
 };
 
 /* Characters used to start/end stereotypes: */
+#ifdef USE_XIM
+#define UML_STEREOTYPE_START "<<"
+#define UML_STEREOTYPE_END ">>"
+#else
 #define UML_STEREOTYPE_START ((char) 171)
 #define UML_STEREOTYPE_END ((char) 187)
+#endif
 
 extern char *uml_get_attribute_string(UMLAttribute *attribute);
 extern char *uml_get_operation_string(UMLOperation *operation);
