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.2
--- 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	Sat Aug 26 21:42:41 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,82 @@
   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_malloc(sizeof(char) * strlen(text) + 1);
+  for(i=0, s=0; i<strlen(text);i++,s++) {
+    if(s==0) {
+      buff[s] = text[i];
+    } else if (text[i-1] < 0 && text[i] < 0) {
+      /* both are 16bits char */
+      buff[s] = text[i];
+    } else if (text[i-1] > 0 && text[i] > 0) {
+      /* for ASCII char */
+      buff[s] = text[i];
+    } else {
+      /* 'text->line[i][j]' is a boundary between single and double chars */
+      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);
+      }
+      buff[s] = '\0';
+      local_draw_string(renderer,
+ 		  buff,
+ 		  &_pos, alignment,
+ 		  color);
+      _pos.x += font_string_width(buff, renderer->font, renderer->font_height);
+      s = 0;
+      buff[s] = text[i];
+    }
+  }
+  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);
+  }
+  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/lib/font.c
diff -u dia/dia-0.86/lib/font.c:1.10 dia/dia-0.86/lib/font.c:1.11
--- dia/dia-0.86/lib/font.c:1.10	Fri Aug 25 20:59:26 2000
+++ dia/dia-0.86/lib/font.c	Sat Aug 26 21:42:42 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,105 +89,109 @@
 
 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",
+    { "Times-Roman", "Ryumin-Light" },
     { "-adobe-times-medium-r-normal-*-%d-*-*-*-*-*-*-*,-aliastt-*-medium-r-normal-*-%d-*-*-*-*-*-jisx0208.1983-0",
       NULL
     }
   }, 
   { "Times-Italic",
-    "Times-Italic",
+    { "Times-Italic", "Ryumin-Light" },
     { "-adobe-times-medium-i-normal-*-%d-*-*-*-*-*-*-*,-aliastt-*-medium-r-normal-*-%d-*-*-*-*-*-jisx0208.1983-0",
       NULL
     }
   }, 
   { "Times-Bold",
-    "Times-Bold",
+    { "Times-Bold", "Ryumin-Light" },
     { "-adobe-times-bold-r-normal-*-%d-*-*-*-*-*-*-*,-aliastt-*-medium-r-normal-*-%d-*-*-*-*-*-jisx0208.1983-0",
       NULL
     }
   }, 
   { "Times-BoldItalic",
-    "Times-BoldItalic",
+    { "Times-BoldItalic", "Ryumin-Light" },
     { "-adobe-times-bold-i-normal-*-%d-*-*-*-*-*-*-*,-aliastt-*-medium-r-normal-*-%d-*-*-*-*-*-jisx0208.1983-0",
       NULL
     }
   }, 
   { "AvantGarde-Book",
-    "AvantGarde-Book",
+    { "AvantGarde-Book", "Ryumin-Light" },
     { "-adobe-avantgarde-book-r-normal-*-%d-*-*-*-*-*-*-*,-aliastt-*-medium-r-normal-*-%d-*-*-*-*-*-jisx0208.1983-0",
       "-schumacher-clean-medium-r-normal-*-%d-*-*-*-*-*-*-*"
     }
   },
   { "AvantGarde-BookOblique",
-    "AvantGarde-BookOblique",
+    { "AvantGarde-BookOblique", "Ryumin-Light" },
     { "-adobe-avantgarde-book-o-normal-*-%d-*-*-*-*-*-*-*,-aliastt-*-medium-r-normal-*-%d-*-*-*-*-*-jisx0208.1983-0",
       "-schumacher-clean-medium-i-normal-*-%d-*-*-*-*-*-*-*"
     }
   },
   { "AvantGarde-Demi",
-    "AvantGarde-Demi",
+    { "AvantGarde-Demi", "Ryumin-Light" },
     { "-adobe-avantgarde-demibold-r-normal-*-%d-*-*-*-*-*-*-*,-aliastt-*-medium-r-normal-*-%d-*-*-*-*-*-jisx0208.1983-0",
       "-schumacher-clean-bold-r-normal-*-%d-*-*-*-*-*-*-*"
     }
   },
   { "AvantGarde-DemiOblique",
-    "AvantGarde-DemiOblique",
+    { "AvantGarde-DemiOblique", "Ryumin-Light" },
     { "-adobe-avantgarde-demibold-o-normal-*-%d-*-*-*-*-*-*-*,-aliastt-*-medium-r-normal-*-%d-*-*-*-*-*-jisx0208.1983-0",
       "-schumacher-clean-bold-i-normal-*-%d-*-*-*-*-*-*-*"
     }
   },
   { "Bookman-Light",
-    "Bookman-Light",
+    { "Bookman-Light", "Ryumin-Light" },
     { "-adobe-bookman-light-r-normal-*-%d-*-*-*-*-*-*-*,-aliastt-*-medium-r-normal-*-%d-*-*-*-*-*-jisx0208.1983-0",
       "-adobe-times-medium-r-normal-*-%d-*-*-*-*-*-*-*"
     }
   },
   { "Bookman-LightItalic",
-    "Bookman-LightItalic",
+    { "Bookman-LightItalic", "Ryumin-Light" },
     { "-adobe-bookman-light-i-normal-*-%d-*-*-*-*-*-*-*,-aliastt-*-medium-r-normal-*-%d-*-*-*-*-*-jisx0208.1983-0",
       "-adobe-times-medium-i-normal-*-%d-*-*-*-*-*-*-*"
     }
   },
   { "Bookman-Demi",
-    "Bookman-Demi",
+    { "Bookman-Demi", "Ryumin-Light" },
     { "-adobe-bookman-demibold-r-normal-*-%d-*-*-*-*-*-*-*,-aliastt-*-medium-r-normal-*-%d-*-*-*-*-*-jisx0208.1983-0",
       "-adobe-times-bold-r-normal-*-%d-*-*-*-*-*-*-*"
     }
   },
   { "Bookman-DemiItalic",
-    "Bookman-DemiItalic",
+    { "Bookman-DemiItalic", "Ryumin-Light" },
     { "-adobe-bookman-demibold-i-normal-*-%d-*-*-*-*-*-*-*,-aliastt-*-medium-r-normal-*-%d-*-*-*-*-*-jisx0208.1983-0",
       "-adobe-times-bold-i-normal-*-%d-*-*-*-*-*-*-*"
     }
   },
 #ifndef G_OS_WIN32
   { "Courier",
-    "Courier",
+    { "Courier", "Ryumin-Light" },
     { "-adobe-courier-medium-r-normal-*-%d-*-*-*-*-*-*-*,-aliastt-*-medium-r-normal-*-%d-*-*-*-*-*-jisx0208.1983-0",
       NULL
     }
   },
   { "Courier-Oblique",
-    "Courier-Oblique",
+    { "Courier-Oblique", "Ryumin-Light" },
     { "-adobe-courier-medium-o-normal-*-%d-*-*-*-*-*-*-*,-aliastt-*-medium-r-normal-*-%d-*-*-*-*-*-jisx0208.1983-0",
       NULL
     }
   },
   { "Courier-Bold",
-    "Courier-Bold",
+    { "Courier-Bold", "Ryumin-Light" },
     { "-adobe-courier-bold-r-normal-*-%d-*-*-*-*-*-*-*,-aliastt-*-medium-r-normal-*-%d-*-*-*-*-*-jisx0208.1983-0",
       NULL
     }
   },
   { "Courier-BoldOblique",
-    "Courier-BoldOblique",
+    { "Courier-BoldOblique", "Ryumin-Light" },
     { "-adobe-courier-bold-o-normal-*-%d-*-*-*-*-*-*-*,-aliastt-*-medium-r-normal-*-%d-*-*-*-*-*-jisx0208.1983-0",
       NULL
     }
@@ -215,116 +227,116 @@
   },
 #endif
   { "Helvetica",
-    "Helvetica",
+    { "Helvetica", "Ryumin-Light" },
     { "-adobe-helvetica-medium-r-normal-*-%d-*-*-*-*-*-*-*,-aliastt-*-medium-r-normal-*-%d-*-*-*-*-*-jisx0208.1983-0",
       NULL
     }
   },
   { "Helvetica-Oblique",
-    "Helvetica-Oblique",
+    { "Helvetica-Oblique", "Ryumin-Light" },
     { "-adobe-helvetica-medium-o-normal-*-%d-*-*-*-*-*-*-*,-aliastt-*-medium-r-normal-*-%d-*-*-*-*-*-jisx0208.1983-0",
       NULL
     }
   },
   { "Helvetica-Bold",
-    "Helvetica-Bold",
+    { "Helvetica-Bold", "Ryumin-Light" },
     { "-adobe-helvetica-bold-r-normal-*-%d-*-*-*-*-*-*-*,-aliastt-*-medium-r-normal-*-%d-*-*-*-*-*-jisx0208.1983-0",
       NULL
     }
   },
   { "Helvetica-BoldOblique",
-    "Helvetica-BoldOblique",
+    { "Helvetica-BoldOblique", "Ryumin-Light" },
     { "-adobe-helvetica-bold-o-normal-*-%d-*-*-*-*-*-*-*,-aliastt-*-medium-r-normal-*-%d-*-*-*-*-*-jisx0208.1983-0",
       NULL
     }
   },
   { "Helvetica-Narrow",
-    "Helvetica-Narrow",
+    { "Helvetica-Narrow", "Ryumin-Light" },
     { "-adobe-helvetica-medium-r-normal-*-%d-*-*-*-*-*-*-*,-aliastt-*-medium-r-normal-*-%d-*-*-*-*-*-jisx0208.1983-0",
       NULL
     }
   },
   { "Helvetica-Narrow-Oblique",
-    "Helvetica-Narrow-Oblique",
+    { "Helvetica-Narrow-Oblique", "Ryumin-Light" },
     { "-adobe-helvetica-medium-o-normal-*-%d-*-*-*-*-*-*-*,-aliastt-*-medium-r-normal-*-%d-*-*-*-*-*-jisx0208.1983-0",
       NULL
     }
   },
   { "Helvetica-Narrow-Bold",
-    "Helvetica-Narrow-Bold",
+    { "Helvetica-Narrow-Bold", "Ryumin-Light" },
     { "-adobe-helvetica-bold-r-normal-*-%d-*-*-*-*-*-*-*,-aliastt-*-medium-r-normal-*-%d-*-*-*-*-*-jisx0208.1983-0",
       NULL
     }
   },
   { "Helvetica-Narrow-BoldOblique",
-    "Helvetica-Narrow-BoldOblique",
+    { "Helvetica-Narrow-BoldOblique", "Ryumin-Light" },
     { "-adobe-helvetica-bold-o-normal-*-%d-*-*-*-*-*-*-*,-aliastt-*-medium-r-normal-*-%d-*-*-*-*-*-jisx0208.1983-0",
       NULL
     }
   },
   { "NewCenturySchoolbook-Roman",
-    "NewCenturySchlbk-Roman",
+    { "NewCenturySchlbk-Roman", "Ryumin-Light" },
     { "-adobe-new century schoolbook-medium-r-normal-*-%d-*-*-*-*-*-*-*,-aliastt-*-medium-r-normal-*-%d-*-*-*-*-*-jisx0208.1983-0",
       NULL
     }
   },
   { "NewCenturySchoolbook-Italic",
-    "NewCenturySchlbk-Italic",
+    { "NewCenturySchlbk-Italic", "Ryumin-Light" },
     { "-adobe-new century schoolbook-medium-i-normal-*-%d-*-*-*-*-*-*-*,-aliastt-*-medium-r-normal-*-%d-*-*-*-*-*-jisx0208.1983-0",
       NULL
     }
   },
   { "NewCenturySchoolbook-Bold",
-    "NewCenturySchlbk-Bold",
+    { "NewCenturySchlbk-Bold", "Ryumin-Light" },
     { "-adobe-new century schoolbook-bold-r-normal-*-%d-*-*-*-*-*-*-*,-aliastt-*-medium-r-normal-*-%d-*-*-*-*-*-jisx0208.1983-0",
       NULL
     }
   },
   { "NewCenturySchoolbook-BoldItalic",
-    "NewCenturySchlbk-BoldItalic",
+    { "NewCenturySchlbk-BoldItalic", "Ryumin-Light" },
     { "-adobe-new century schoolbook-bold-i-normal-*-%d-*-*-*-*-*-*-*,-aliastt-*-medium-r-normal-*-%d-*-*-*-*-*-jisx0208.1983-0",
       NULL
     }
   },
   { "Palatino-Roman",
-    "Palatino-Roman",
+    { "Palatino-Roman", "Ryumin-Light" },
     { "-adobe-palatino-medium-r-normal-*-%d-*-*-*-*-*-*-*,-aliastt-*-medium-r-normal-*-%d-*-*-*-*-*-jisx0208.1983-0",
       "-*-lucidabright-medium-r-normal-*-%d-*-*-*-*-*-*-*"
     }
   },
   { "Palatino-Italic",
-    "Palatino-Italic",
+    { "Palatino-Italic", "Ryumin-Light" },
     { "-adobe-palatino-medium-i-normal-*-%d-*-*-*-*-*-*-*,-aliastt-*-medium-r-normal-*-%d-*-*-*-*-*-jisx0208.1983-0",
       "-*-lucidabright-medium-i-normal-*-%d-*-*-*-*-*-*-*"
     }
   },
   { "Palatino-Bold",
-    "Palatino-Bold",
+    { "Palatino-Bold", "Ryumin-Light" },
     { "-adobe-palatino-bold-r-normal-*-%d-*-*-*-*-*-*-*,-aliastt-*-medium-r-normal-*-%d-*-*-*-*-*-jisx0208.1983-0",
       "-*-lucidabright-demibold-r-normal-*-%d-*-*-*-*-*-*-*"
     }
   },
   { "Palatino-BoldItalic",
-    "Palatino-BoldItalic",
+    { "Palatino-BoldItalic", "Ryumin-Light" },
     { "-adobe-palatino-bold-i-normal-*-%d-*-*-*-*-*-*-*,-aliastt-*-medium-r-normal-*-%d-*-*-*-*-*-jisx0208.1983-0",
       "-*-lucidabright-demibold-i-normal-*-%d-*-*-*-*-*-*-*"
     }
   },
   { "Symbol",
-    "Symbol",
+    { "Symbol", "Ryumin-Light" },
     {
       "-adobe-symbol-medium-r-normal-*-%d-*-*-*-*-*-*-*,-aliastt-*-medium-r-normal-*-%d-*-*-*-*-*-jisx0208.1983-0",
       "-*-symbol-medium-r-normal-*-%d-*-*-*-*-*-*-*"
     }
   },
   { "ZapfChancery-MediumItalic",
-    "ZapfChancery-MediumItalic",
+    { "ZapfChancery-MediumItalic", "Ryumin-Light" },
     { "-adobe-zapf chancery-medium-i-normal-*-%d-*-*-*-*-*-*-*,-aliastt-*-medium-r-normal-*-%d-*-*-*-*-*-jisx0208.1983-0",
       "-*-itc zapf chancery-medium-i-normal-*-%d-*-*-*-*-*-*-*"
     }
   },
   { "ZapfDingbats",
-    "ZapfDingbats",
+    { "ZapfDingbats", "Ryumin-Light" },
     { "-adobe-zapf dingbats-medium-r-normal-*-%d-*-*-*-*-*-*-*,-aliastt-*-medium-r-normal-*-%d-*-*-*-*-*-jisx0208.1983-0",
       "-*-itc zapf dingbats-*-*-*-*-%d-*-*-*-*-*-*-*"
     }
@@ -664,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;
@@ -793,7 +811,28 @@
   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)
 {
   FontPrivate *fontprivate;
@@ -802,6 +841,7 @@
   
   return fontprivate->fontname_ps;
 }
+#endif
 
 real
 font_string_width(const char *string, Font *font, real height)
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);
