Binary files amiwm/Keyboard and amiwm0.20pl28-i18n/Keyboard differ
diff -Ncr amiwm/Makefile.in amiwm0.20pl28-i18n/Makefile.in
*** amiwm/Makefile.in	Sat Aug  3 02:25:35 1996
--- amiwm0.20pl28-i18n/Makefile.in	Sun Feb  1 02:37:51 1998
***************
*** 1,7 ****
  srcdir = @srcdir@
  VPATH = @srcdir@
  SHELL = /bin/sh
! CC = @CC@
  LEX = @LEX@
  YACC = @YACC@
  CFLAGS = @CFLAGS@
--- 1,7 ----
  srcdir = @srcdir@
  VPATH = @srcdir@
  SHELL = /bin/sh
! CC = @CC@ -DI18N -DX_LOCALE
  LEX = @LEX@
  YACC = @YACC@
  CFLAGS = @CFLAGS@
diff -Ncr amiwm/config.cache amiwm0.20pl28-i18n/config.cache
*** amiwm/config.cache	Thu Jan  1 09:00:00 1970
--- amiwm0.20pl28-i18n/config.cache	Sat Jan 31 22:45:22 1998
***************
*** 0 ****
--- 1,55 ----
+ # This file is a shell script that caches the results of configure
+ # tests run on this system so they can be shared between configure
+ # scripts and configure runs.  It is not useful on other systems.
+ # If it contains results you don't want to keep, you may remove or edit it.
+ #
+ # By default, configure uses ./config.cache as the cache file,
+ # creating it if it does not exist already.  You can give configure
+ # the --cache-file=FILE option to use a different cache file; that is
+ # what configure does when it calls configure scripts in
+ # subdirectories, so they share the cache.
+ # Giving --cache-file=/dev/null disables caching, for debugging configure.
+ # config.status only pays attention to the cache file if you give it the
+ # --recheck option to rerun configure.
+ #
+ ac_cv_c_const=${ac_cv_c_const='yes'}
+ ac_cv_c_cross=${ac_cv_c_cross='no'}
+ ac_cv_func_alloca=${ac_cv_func_alloca='yes'}
+ ac_cv_func_select=${ac_cv_func_select='yes'}
+ ac_cv_func_strdup=${ac_cv_func_strdup='yes'}
+ ac_cv_func_wait3=${ac_cv_func_wait3='yes'}
+ ac_cv_func_waitpid=${ac_cv_func_waitpid='yes'}
+ ac_cv_header_alloca_h=${ac_cv_header_alloca_h='yes'}
+ ac_cv_header_fcntl_h=${ac_cv_header_fcntl_h='yes'}
+ ac_cv_header_limits_h=${ac_cv_header_limits_h='yes'}
+ ac_cv_header_stdc=${ac_cv_header_stdc='yes'}
+ ac_cv_header_sys_resource_h=${ac_cv_header_sys_resource_h='yes'}
+ ac_cv_header_sys_select_h=${ac_cv_header_sys_select_h='no'}
+ ac_cv_header_sys_stat_h=${ac_cv_header_sys_stat_h='yes'}
+ ac_cv_header_sys_time_h=${ac_cv_header_sys_time_h='yes'}
+ ac_cv_header_sys_wait_h=${ac_cv_header_sys_wait_h='yes'}
+ ac_cv_header_termio_h=${ac_cv_header_termio_h='yes'}
+ ac_cv_header_time=${ac_cv_header_time='yes'}
+ ac_cv_header_unistd_h=${ac_cv_header_unistd_h='yes'}
+ ac_cv_lib_ICE=${ac_cv_lib_ICE='yes'}
+ ac_cv_lib_dnet=${ac_cv_lib_dnet='no'}
+ ac_cv_lib_dnet_stub=${ac_cv_lib_dnet_stub='no'}
+ ac_cv_lib_fl=${ac_cv_lib_fl='yes'}
+ ac_cv_lib_nsl=${ac_cv_lib_nsl='no'}
+ ac_cv_lib_socket=${ac_cv_lib_socket='no'}
+ ac_cv_path_install=${ac_cv_path_install='/usr/bin/ginstall -c'}
+ ac_cv_path_x=${ac_cv_path_x='no_x= ac_x_includes=/usr/X11R6/include ac_x_libraries=/usr/X11R6/lib'}
+ ac_cv_prog_AWK=${ac_cv_prog_AWK='gawk'}
+ ac_cv_prog_CC=${ac_cv_prog_CC='gcc'}
+ ac_cv_prog_CPP=${ac_cv_prog_CPP='gcc -E'}
+ ac_cv_prog_LEX=${ac_cv_prog_LEX='flex'}
+ ac_cv_prog_LN_S=${ac_cv_prog_LN_S='ln -s'}
+ ac_cv_prog_RANLIB=${ac_cv_prog_RANLIB='ranlib'}
+ ac_cv_prog_YACC=${ac_cv_prog_YACC='bison -y'}
+ ac_cv_prog_gcc=${ac_cv_prog_gcc='yes'}
+ ac_cv_prog_gcc_g=${ac_cv_prog_gcc_g='yes'}
+ ac_cv_struct_tm=${ac_cv_struct_tm='time.h'}
+ ac_cv_type_caddr_t=${ac_cv_type_caddr_t='yes'}
+ ac_cv_type_pid_t=${ac_cv_type_pid_t='yes'}
+ ac_cv_type_signal=${ac_cv_type_signal='void'}
+ ac_cv_type_size_t=${ac_cv_type_size_t='yes'}
diff -Ncr amiwm/config.status amiwm0.20pl28-i18n/config.status
*** amiwm/config.status	Thu Jan  1 09:00:00 1970
--- amiwm0.20pl28-i18n/config.status	Sun Feb  1 02:38:22 1998
***************
*** 0 ****
--- 1,136 ----
+ #! /bin/sh
+ # Generated automatically by configure.
+ # Run this file to recreate the current configuration.
+ # This directory was configured as follows,
+ # on host tunny:
+ #
+ # ./configure 
+ #
+ # Compiler output produced by configure, useful for debugging
+ # configure, is in ./config.log if it exists.
+ 
+ ac_cs_usage="Usage: ./config.status [--recheck] [--version] [--help]"
+ for ac_option
+ do
+   case "$ac_option" in
+   -recheck | --recheck | --rechec | --reche | --rech | --rec | --re | --r)
+     echo "running ${CONFIG_SHELL-/bin/sh} ./configure  --no-create --no-recursion"
+     exec ${CONFIG_SHELL-/bin/sh} ./configure  --no-create --no-recursion ;;
+   -version | --version | --versio | --versi | --vers | --ver | --ve | --v)
+     echo "./config.status generated by autoconf version 2.7"
+     exit 0 ;;
+   -help | --help | --hel | --he | --h)
+     echo "$ac_cs_usage"; exit 0 ;;
+   *) echo "$ac_cs_usage"; exit 1 ;;
+   esac
+ done
+ 
+ ac_given_srcdir=.
+ ac_given_INSTALL="/usr/bin/ginstall -c"
+ 
+ trap 'rm -fr Makefile libami/Makefile conftest*; exit 1' 1 2 15
+ 
+ # Protect against being on the right side of a sed subst in config.status.
+ sed 's/%@/@@/; s/@%/@@/; s/%g$/@g/; /@g$/s/[\\&%]/\\&/g;
+  s/@@/%@/; s/@@/@%/; s/@g$/%g/' > conftest.subs <<\CEOF
+ /^[ 	]*VPATH[ 	]*=[^:]*$/d
+ 
+ s%@CFLAGS@%-g -O%g
+ s%@CPPFLAGS@%%g
+ s%@CXXFLAGS@%%g
+ s%@DEFS@% -DSTDC_HEADERS=1 -DHAVE_SYS_WAIT_H=1 -DHAVE_FCNTL_H=1 -DHAVE_LIMITS_H=1 -DHAVE_SYS_TIME_H=1 -DHAVE_UNISTD_H=1 -DHAVE_SYS_RESOURCE_H=1 -DHAVE_SYS_STAT_H=1 -DHAVE_TERMIO_H=1 -DTIME_WITH_SYS_TIME=1 -DHAVE_ALLOCA_H=1 -DHAVE_ALLOCA=1 -DRETSIGTYPE=void -DHAVE_WAIT3=1 -DHAVE_SELECT=1 -DHAVE_STRDUP=1 -DHAVE_WAITPID=1 -DBSD_STYLE_GETTIMEOFDAY=1 %g
+ s%@LDFLAGS@%%g
+ s%@LIBS@%%g
+ s%@exec_prefix@%${prefix}%g
+ s%@prefix@%/usr/local%g
+ s%@program_transform_name@%s,x,x,%g
+ s%@bindir@%${exec_prefix}/bin%g
+ s%@sbindir@%${exec_prefix}/sbin%g
+ s%@libexecdir@%${exec_prefix}/libexec%g
+ s%@datadir@%${prefix}/share%g
+ s%@sysconfdir@%${prefix}/etc%g
+ s%@sharedstatedir@%${prefix}/com%g
+ s%@localstatedir@%${prefix}/var%g
+ s%@libdir@%${exec_prefix}/lib%g
+ s%@includedir@%${prefix}/include%g
+ s%@oldincludedir@%/usr/include%g
+ s%@infodir@%${prefix}/info%g
+ s%@mandir@%${prefix}/man%g
+ s%@CC@%gcc%g
+ s%@AWK@%gawk%g
+ s%@YACC@%bison -y%g
+ s%@LEX@%flex%g
+ s%@LEXLIB@%-lfl%g
+ s%@INSTALL_PROGRAM@%${INSTALL}%g
+ s%@INSTALL_DATA@%${INSTALL} -m 644%g
+ s%@LN_S@%ln -s%g
+ s%@RANLIB@%ranlib%g
+ s%@CPP@%gcc -E%g
+ s%@X_CFLAGS@% -I/usr/X11R6/include%g
+ s%@X_PRE_LIBS@% -lSM -lICE%g
+ s%@X_LIBS@% -L/usr/X11R6/lib%g
+ s%@X_EXTRA_LIBS@%%g
+ s%@ALLOCA@%%g
+ s%@XT_LIB_KLUDGE@%%g
+ s%@x_includes@%/usr/X11R6/include%g
+ s%@x_libraries@%/usr/X11R6/lib%g
+ 
+ CEOF
+ 
+ CONFIG_FILES=${CONFIG_FILES-"Makefile libami/Makefile"}
+ for ac_file in .. $CONFIG_FILES; do if test "x$ac_file" != x..; then
+   # Support "outfile[:infile]", defaulting infile="outfile.in".
+   case "$ac_file" in
+   *:*) ac_file_in=`echo "$ac_file"|sed 's%.*:%%'`
+        ac_file=`echo "$ac_file"|sed 's%:.*%%'` ;;
+   *) ac_file_in="${ac_file}.in" ;;
+   esac
+ 
+   # Adjust relative srcdir, etc. for subdirectories.
+ 
+   # Remove last slash and all that follows it.  Not all systems have dirname.
+   ac_dir=`echo $ac_file|sed 's%/[^/][^/]*$%%'`
+   if test "$ac_dir" != "$ac_file" && test "$ac_dir" != .; then
+     # The file is in a subdirectory.
+     test ! -d "$ac_dir" && mkdir "$ac_dir"
+     ac_dir_suffix="/`echo $ac_dir|sed 's%^\./%%'`"
+     # A "../" for each directory in $ac_dir_suffix.
+     ac_dots=`echo $ac_dir_suffix|sed 's%/[^/]*%../%g'`
+   else
+     ac_dir_suffix= ac_dots=
+   fi
+ 
+   case "$ac_given_srcdir" in
+   .)  srcdir=.
+       if test -z "$ac_dots"; then top_srcdir=.
+       else top_srcdir=`echo $ac_dots|sed 's%/$%%'`; fi ;;
+   /*) srcdir="$ac_given_srcdir$ac_dir_suffix"; top_srcdir="$ac_given_srcdir" ;;
+   *) # Relative path.
+     srcdir="$ac_dots$ac_given_srcdir$ac_dir_suffix"
+     top_srcdir="$ac_dots$ac_given_srcdir" ;;
+   esac
+ 
+   case "$ac_given_INSTALL" in
+   [/$]*) INSTALL="$ac_given_INSTALL" ;;
+   *) INSTALL="$ac_dots$ac_given_INSTALL" ;;
+   esac
+   echo creating "$ac_file"
+   rm -f "$ac_file"
+   configure_input="Generated automatically from `echo $ac_file_in|sed 's%.*/%%'` by configure."
+   case "$ac_file" in
+   *Makefile*) ac_comsub="1i\\
+ # $configure_input" ;;
+   *) ac_comsub= ;;
+   esac
+   sed -e "$ac_comsub
+ s%@configure_input@%$configure_input%g
+ s%@srcdir@%$srcdir%g
+ s%@top_srcdir@%$top_srcdir%g
+ s%@INSTALL@%$INSTALL%g
+ " -f conftest.subs $ac_given_srcdir/$ac_file_in > $ac_file
+ fi; done
+ rm -f conftest.subs
+ 
+ 
+ 
+ exit 0
diff -Ncr amiwm/executecmd.c amiwm0.20pl28-i18n/executecmd.c
*** amiwm/executecmd.c	Fri Aug  2 23:31:01 1996
--- amiwm0.20pl28-i18n/executecmd.c	Sat Jan 31 23:25:39 1998
***************
*** 71,81 ****
--- 71,89 ----
  
  void refresh_button(Window w, const char *txt, int idx)
  {
+   XFontSetExtents *extent;
    int h=fh+2*BUT_VSPACE, l=strlen(txt);
    int tw=XTextWidth(dri.dri_Font, txt, l);
    XSetForeground(dpy, gc, dri.dri_Pens[TEXTPEN]);
+ #ifdef I18N
+   extent = XExtentsOfFontSet(dri.dri_Font);
+   XmbDrawString (dpy, w, dri.dri_Font, gc, (butw-tw)>>1,
+ 		 extent->max_logical_extent.height+BUT_VSPACE,
+ 		 txt, l);
+ #else
    XDrawString(dpy, w, gc, (butw-tw)>>1,
  	      dri.dri_Font->ascent+BUT_VSPACE, txt, l);
+ #endif
    XSetForeground(dpy, gc, dri.dri_Pens[(selected==idx && depressed)?
  				     SHADOWPEN:SHINEPEN]);
    XDrawLine(dpy, w, gc, 0, 0, butw-2, 0);
***************
*** 92,131 ****
--- 100,175 ----
  void refresh_main(void)
  {
    int w;
+   XFontSetExtents *extent;
  
    XSetForeground(dpy, gc, dri.dri_Pens[TEXTPEN]);
+ #ifdef I18N
+   extent = XExtentsOfFontSet(dri.dri_Font);
+   XmbDrawString (dpy, mainwin, dri.dri_Font, gc, TEXT_SIDE,
+ 		 TOP_SPACE+extent->max_logical_extent.height,
+ 		 enter_txt, strlen(enter_txt));
+ #else
    XDrawString(dpy, mainwin, gc, TEXT_SIDE, TOP_SPACE+dri.dri_Font->ascent,
  	      enter_txt, strlen(enter_txt));
+ #endif
    XSetForeground(dpy, gc, dri.dri_Pens[HIGHLIGHTTEXTPEN]);
    w=XTextWidth(dri.dri_Font, cmd_txt, strlen(cmd_txt));
+ #ifdef I18N
+   XmbDrawString (dpy, mainwin, dri.dri_Font, gc, 
+ 	 mainw-strgadw-w-TEXT_SIDE-BUT_SIDE,
+ 	 TOP_SPACE+fh+INT_SPACE+extent->max_logical_extent.height,
+ 	 cmd_txt, strlen(cmd_txt));
+ #else
    XDrawString(dpy, mainwin, gc, mainw-strgadw-w-TEXT_SIDE-BUT_SIDE,
  	      TOP_SPACE+fh+INT_SPACE+dri.dri_Font->ascent,
  	      cmd_txt, strlen(cmd_txt));
+ #endif
  }
  
  void refresh_str_text(void)
  {
+   XFontSetExtents *extent;
    int l, mx=6;
    XSetForeground(dpy, gc, dri.dri_Pens[TEXTPEN]);
    if(buf_len>left_pos) {
      mx+=XTextWidth(dri.dri_Font, cmdline+left_pos, l=buf_len-left_pos);
      while(mx>strgadw-6)
        mx-=XTextWidth(dri.dri_Font, cmdline+left_pos+--l, 1);
+ #ifdef I18N
+     extent = XExtentsOfFontSet(dri.dri_Font);
+     XmbDrawImageString(dpy, strwin, dri.dri_Font, gc,
+ 		       6, 3+extent->max_logical_extent.height,
+ 		       cmdline+left_pos, l);
+ #else
      XDrawImageString(dpy, strwin, gc, 6, 3+dri.dri_Font->ascent,
  		     cmdline+left_pos, l);
+ #endif
    }
    XSetForeground(dpy, gc, dri.dri_Pens[BACKGROUNDPEN]);
    XFillRectangle(dpy, strwin, gc, mx, 3, strgadw-mx-6, fh);
    if(stractive) {
      if(cur_pos<buf_len) {
        XSetBackground(dpy, gc, ~0);
+ #ifdef I18N
+       extent = XExtentsOfFontSet(dri.dri_Font);
+       XmbDrawImageString(dpy, strwin, dri.dri_Font, gc,
+ 			 cur_x, 3+extent->max_logical_extent.height,
+ 			 cmdline+cur_pos, l);
+ #else
        XDrawImageString(dpy, strwin, gc, cur_x, 3+dri.dri_Font->ascent,
  		       cmdline+cur_pos, 1);
+ #endif
        XSetBackground(dpy, gc, dri.dri_Pens[BACKGROUNDPEN]);
      } else {
        XSetForeground(dpy, gc, ~0);
+ #ifdef I18N
+       /* how should be implemented? */
+       XFillRectangle(dpy, strwin, gc, cur_x, 3,
+ 		     XTextWidth(dri.dri_Font, "$", 1), fh);
+ #else
        XFillRectangle(dpy, strwin, gc, cur_x, 3,
  		     dri.dri_Font->max_bounds.width, fh);
+ #endif
      }
    }
  }
***************
*** 207,214 ****
      cur_x+=XTextWidth(dri.dri_Font, cmdline+left_pos, cur_pos-left_pos);
    if(cur_pos<buf_len)
      x=XTextWidth(dri.dri_Font, cmdline+cur_pos, 1);
!   else
      x=dri.dri_Font->max_bounds.width;
    if((x+=cur_x-(strgadw-6))>0) {
      cur_x-=x;
      while(x>0)
--- 251,264 ----
      cur_x+=XTextWidth(dri.dri_Font, cmdline+left_pos, cur_pos-left_pos);
    if(cur_pos<buf_len)
      x=XTextWidth(dri.dri_Font, cmdline+cur_pos, 1);
!   else {
! #ifdef I18N
!     /* how should be implemented? */
!     x=XTextWidth(dri.dri_Font, "$", 1);
! #else
      x=dri.dri_Font->max_bounds.width;
+ #endif
+   }
    if((x+=cur_x-(strgadw-6))>0) {
      cur_x-=x;
      while(x>0)
***************
*** 265,270 ****
--- 315,321 ----
  int main(int argc, char *argv[])
  {
    XWindowAttributes attr;
+   XFontSetExtents *extent;
    static XSizeHints size_hints;
    static XTextProperty txtprop1, txtprop2;
    Window ok, cancel;
***************
*** 280,287 ****
--- 331,344 ----
    XGetWindowAttributes(dpy, root, &attr);
    init_dri(&dri, root, attr.colormap, False);
  
+ #ifdef I18N
+   extent = XExtentsOfFontSet(dri.dri_Font);
+   strgadw=VISIBLE_CMD_CHARS*XTextWidth(dri.dri_Font,"$",1)+12;
+   strgadh=(fh=extent->max_logical_extent.height*5/4)+6;
+ #else
    strgadw=VISIBLE_CMD_CHARS*dri.dri_Font->max_bounds.width+12;
    strgadh=(fh=dri.dri_Font->ascent+dri.dri_Font->descent)+6;
+ #endif
  
    butw=XTextWidth(dri.dri_Font, ok_txt, strlen(ok_txt))+2*BUT_HSPACE;
    w2=XTextWidth(dri.dri_Font, cancel_txt, strlen(cancel_txt))+2*BUT_HSPACE;
***************
*** 328,335 ****
  		 EnterWindowMask|LeaveWindowMask);
    gc=XCreateGC(dpy, mainwin, 0, NULL);
    XSetBackground(dpy, gc, dri.dri_Pens[BACKGROUNDPEN]);
    XSetFont(dpy, gc, dri.dri_Font->fid);
! 
    size_hints.flags = PResizeInc;
    txtprop1.value=(unsigned char *)"Execute a File";
    txtprop2.value=(unsigned char *)"ExecuteCmd";
--- 385,393 ----
  		 EnterWindowMask|LeaveWindowMask);
    gc=XCreateGC(dpy, mainwin, 0, NULL);
    XSetBackground(dpy, gc, dri.dri_Pens[BACKGROUNDPEN]);
+ #ifndef I18N
    XSetFont(dpy, gc, dri.dri_Font->fid);
! #endif
    size_hints.flags = PResizeInc;
    txtprop1.value=(unsigned char *)"Execute a File";
    txtprop2.value=(unsigned char *)"ExecuteCmd";
diff -Ncr amiwm/frame.c amiwm0.20pl28-i18n/frame.c
*** amiwm/frame.c	Tue Jul 30 18:18:10 1996
--- amiwm0.20pl28-i18n/frame.c	Sun Feb  1 03:21:34 1998
***************
*** 1,3 ****
--- 1,4 ----
+ 
  #include <X11/Xlib.h>
  #include <X11/Xutil.h>
  #include <stdio.h>
***************
*** 184,189 ****
--- 185,192 ----
  
  void redraw(Client *c, Window w)
  {
+   XFontSetExtents *extent;
+ 
    if(w==c->parent) {
      int x, y;
      x=c->pwidth-((c->proto&Psizeright)?18:4);
***************
*** 223,231 ****
--- 226,256 ----
    } else if(w==c->drag) {
      XSetForeground(dpy, scr->gc, scr->dri.dri_Pens[c->active?FILLTEXTPEN:TEXTPEN]);
      XSetBackground(dpy, scr->gc, scr->dri.dri_Pens[c->active?FILLPEN:BACKGROUNDPEN]);
+ #ifdef I18N
+     if(c->title.value) {
+       char** cl;
+       char *name;
+       int n;
+       XmbTextPropertyToTextList(dpy, &(c->title), &cl, &n);
+       if (cl) {
+ 	name = (char *)calloc(strlen(cl[0]) + 1, sizeof(char));
+ 	strcpy(name, cl[0]);
+ 	XFreeStringList(cl);
+       } else {
+ 	name = (char *)calloc(9, sizeof(char));
+ 	strcpy(name, "Untitled");
+       }
+       extent = XExtentsOfFontSet(scr->dri.dri_Font);
+       XmbDrawImageString(dpy, w, scr->dri.dri_Font, scr->gc,
+ 			 11, 1+extent->max_logical_extent.height,
+ 			 name, strlen(name));
+       free(name);
+     }
+ #else
      if(c->title.value)
        XDrawImageString(dpy, w, scr->gc, 11, 1+scr->dri.dri_Font->ascent,
  		       c->title.value, c->title.nitems);
+ #endif
      XSetForeground(dpy, scr->gc, scr->dri.dri_Pens[SHINEPEN]);
      XDrawLine(dpy, w, scr->gc, 0, 0, c->dragw-1, 0);
      XDrawLine(dpy, w, scr->gc, 0, 0, 0, scr->bh-2);
diff -Ncr amiwm/icon.c amiwm0.20pl28-i18n/icon.c
*** amiwm/icon.c	Sat Apr 27 04:30:52 1996
--- amiwm0.20pl28-i18n/icon.c	Sun Feb  1 03:03:19 1998
***************
*** 19,30 ****
--- 19,39 ----
  extern char *progname;
  extern XContext icon_context;
  
+ #ifdef I18N
+ XFontSet labelfont = 0;
+ #else
  XFontStruct *labelfont;
+ #endif
  
+ #ifdef I18N
+ char *label_font_name="-b&h-lucida-medium-r-normal-sans-12-*-*-*-*-*-iso8859-1,-mnkaname-*-medium-r-normal--12-*-*-*-*-*-jisx0208.1983-0";
+ #else
  char *label_font_name="-b&h-lucida-medium-r-normal-sans-10-*-*-*-*-*-iso8859-1";
+ #endif
  
  void redrawicon(Icon *i, Window w)
  {
+   XFontSetExtents *extent;
    Pixmap pm;
  
    scr=i->scr;
***************
*** 54,62 ****
--- 63,93 ----
      XDrawLine(dpy, w, scr->gc, 1, i->height-1, i->width-1, i->height-1);
      XDrawLine(dpy, w, scr->gc, i->width-1, 1, i->width-1, i->height-1);
    } else if(w==i->labelwin) {
+ #ifdef I18N
+     if(i->label.value) {
+       char** cl;
+       char *name;
+       int n;
+       XmbTextPropertyToTextList(dpy, &(i->label), &cl, &n);
+       if (cl) {
+ 	name = (char *)calloc(strlen(cl[0]) + 1, sizeof(char));
+ 	strcpy(name, cl[0]);
+ 	XFreeStringList(cl);
+       } else {
+ 	name = (char *)calloc(3, sizeof(char));
+ 	strcpy(name, "()");
+       }
+       extent = XExtentsOfFontSet(labelfont);
+       XmbDrawImageString (dpy, w, labelfont, scr->icongc, 0,
+ 			  extent->max_logical_extent.height,
+ 			  name, strlen(name));
+       free(name);
+     }
+ #else
      XDrawImageString(dpy, w, scr->icongc, 0, labelfont->ascent,
  		     (i->label.value? (char *)i->label.value:"()"),
  		     i->label.nitems);
+ #endif
    }
  }
  
diff -Ncr amiwm/libami/Makefile.in amiwm0.20pl28-i18n/libami/Makefile.in
*** amiwm/libami/Makefile.in	Sun Apr 28 07:00:25 1996
--- amiwm0.20pl28-i18n/libami/Makefile.in	Sun Feb  1 02:38:07 1998
***************
*** 5,11 ****
  LEX = @LEX@
  YACC = @YACC@
  RANLIB = @RANLIB@
! CFLAGS = @CFLAGS@
  YFLAGS = -d
  DEFS = @DEFS@
  ALL_CFLAGS = -I@srcdir@ -I@top_srcdir@ $(DEFS) $(CFLAGS) @X_CFLAGS@
--- 5,11 ----
  LEX = @LEX@
  YACC = @YACC@
  RANLIB = @RANLIB@
! CFLAGS = @CFLAGS@ -DI18N -DX_LOCALE
  YFLAGS = -d
  DEFS = @DEFS@
  ALL_CFLAGS = -I@srcdir@ -I@top_srcdir@ $(DEFS) $(CFLAGS) @X_CFLAGS@
diff -Ncr amiwm/libami/drawinfo.c amiwm0.20pl28-i18n/libami/drawinfo.c
*** amiwm/libami/drawinfo.c	Wed Feb 21 03:16:33 1996
--- amiwm0.20pl28-i18n/libami/drawinfo.c	Sun Feb  1 02:51:51 1998
***************
*** 27,34 ****
--- 27,39 ----
    black, white, black
  };
  
+ #ifdef I18N
+ char *default_screenfont =
+ "-b&h-lucida-medium-r-normal-sans-12-*-*-*-*-*-iso8859-1,-mnkaname-*-medium-r-normal--12-*-*-*-*-*-jisx0208.1983-0";
+ #else
  char *default_screenfont =
  "-b&h-lucida-medium-r-normal-sans-12-*-*-*-*-*-iso8859-1";
+ #endif
  
  static void setdriprop(Atom atom, Atom typ, Window win, struct DrawInfo *dri)
  {
***************
*** 37,43 ****
--- 42,52 ----
    *p++=TAG_DRI_VERSION;
    *p++=dri->dri_Version;
    *p++=TAG_DRI_FONT;
+ #ifdef I18N
+   *p++=dri->dri_Font;
+ #else
    *p++=dri->dri_Font->fid;
+ #endif
    *p++=TAG_DRI_PENS;
    *p++=dri->dri_NumPens;
    for(i=0; i<dri->dri_NumPens; i++)
***************
*** 53,58 ****
--- 62,71 ----
    unsigned long nitems, extra;
    int i,j,n;
    CARD32 *prop=NULL;
+   int  missing_charset_count;
+   char **missing_charset_list;
+   char *def_string;
+ 
    if(XGetWindowProperty(dpy, win, atom, 0l, NUMDRIPENS+6, False, typ,
  			&atyp, &afmt, &nitems, &extra,
  			(unsigned char **)&prop) == Success &&
***************
*** 64,71 ****
--- 77,97 ----
  	  dri->dri_Version=prop[i++];
  	break;
        case TAG_DRI_FONT:
+ #ifdef I18N
+ 	if(i<nitems) {
+ 	  fprintf(stderr, "fontset: %s\n", prop[i]);
+ 	  dri->dri_Font=XCreateFontSet(dpy, prop[i++],
+ 	     &missing_charset_list, &missing_charset_count,
+ 	     &def_string);
+ 	  if (missing_charset_count) {
+ 	    fprintf(stderr, "Missing charsets in FontSet creation\n");
+ 	    XFreeStringList(missing_charset_list);
+ 	  }
+ 	}
+ #else
  	if(i<nitems)
  	  dri->dri_Font=XQueryFont(dpy, prop[i++]);
+ #endif
  	break;
        case TAG_DRI_PENS:
  	if(i<nitems) {
***************
*** 119,124 ****
--- 145,153 ----
  {
    int i;
    Atom driatom, dritypatom;
+   int  missing_charset_count;
+   char **missing_charset_list;
+   char *def_string;
  
    memset(dri, 0, sizeof(*dri));
    driatom=XInternAtom(dpy, "AMIWM_DRAWINFO", False);
***************
*** 136,147 ****
--- 165,193 ----
        dri->dri_Pens[i] = allocdripen(i, cm);
      dri->dri_NumPens = NUMDRIPENS;
    }
+ #ifdef I18N
+   if(!dri->dri_Font) {
+     dri->dri_Font=XCreateFontSet(dpy, default_screenfont,
+ 	 &missing_charset_list, &missing_charset_count,
+ 	 &def_string);
+     if (!dri->dri_Font) {
+       fprintf(stderr, "%s: cannot open font %s\n", progname,
+ 	      default_screenfont);
+       exit(1);
+     }
+     if (missing_charset_count) {
+       fprintf(stderr, "Missing charsets in FontSet creation\n");
+       XFreeStringList(missing_charset_list);
+     }
+   }
+ #else
    if(!dri->dri_Font)
      if(!(dri->dri_Font = XLoadQueryFont(dpy, default_screenfont))) {
        fprintf(stderr, "%s: cannot open font %s\n", progname,
  	      default_screenfont);
        exit(1);
      }
+ #endif
    if(override)
      setdriprop(driatom, dritypatom, root, dri);
  }
diff -Ncr amiwm/libami/drawinfo.h amiwm0.20pl28-i18n/libami/drawinfo.h
*** amiwm/libami/drawinfo.h	Wed Feb 21 03:42:51 1996
--- amiwm0.20pl28-i18n/libami/drawinfo.h	Sat Jan 31 21:28:01 1998
***************
*** 2,7 ****
--- 2,11 ----
  #include <X11/Xlib.h>
  #include <X11/Xmd.h>
  
+ #ifdef I18N
+ #define XTextWidth(f,t,l) XmbTextEscapement(f,t,l)
+ #endif
+ 
  #define DRI_VERSION     (2)
  
  struct DrawInfo
***************
*** 10,16 ****
--- 14,24 ----
      CARD16        dri_NumPens;    /* guaranteed to be >= 9                */
      unsigned long *dri_Pens;      /* pointer to pen array                 */
   
+ #ifdef I18N
+     XFontSet     dri_Font;       /* screen default font          */
+ #else
      XFontStruct  *dri_Font;      /* screen default font          */
+ #endif
      CARD16       dri_Depth;      /* (initial) depth of screen bitmap     */
   
      struct {      /* from DisplayInfo database for initial display mode */
diff -Ncr amiwm/main.c amiwm0.20pl28-i18n/main.c
*** amiwm/main.c	Thu Aug  1 21:13:59 1996
--- amiwm0.20pl28-i18n/main.c	Sun Feb  1 01:40:55 1998
***************
*** 3,8 ****
--- 3,9 ----
  #include <X11/cursorfont.h>
  #include <X11/Xproto.h>
  #include <X11/keysym.h>
+ #include <X11/Xlocale.h>
  #ifdef AMIGAOS
  #include <x11/xtrans.h>
  #endif
***************
*** 99,105 ****
  extern void *getitembyhotkey(char);
  extern void menuaction(void *);
  extern void screentoback();
! extern void openscreen(char *, Window);
  extern void realizescreens(void);
  extern Scrn *getscreenbyroot(Window);
  extern void assimilate(Window, int, int);
--- 100,106 ----
  extern void *getitembyhotkey(char);
  extern void menuaction(void *);
  extern void screentoback();
! extern Scrn *openscreen(char *, Window);
  extern void realizescreens(void);
  extern Scrn *getscreenbyroot(Window);
  extern void assimilate(Window, int, int);
***************
*** 696,701 ****
--- 697,707 ----
    XWindowAttributes attr;
    int x_fd;
  
+ #ifdef I18N
+  if (setlocale(LC_CTYPE, "") == NULL)
+    fprintf(stderr, "Can't set locale.\n");
+ #endif
+ 
    main_argv=argv;
    progname=argv[0];
    if(!(dpy = XOpenDisplay(NULL))) {
***************
*** 743,750 ****
  
    lookup_keysyms(dpy, &meta_mask, &switch_mask);
  
!   if(!front)
!     openscreen("Workbench Screen", DefaultRootWindow(dpy));
    realizescreens();
  
    initting = 0;
--- 749,757 ----
  
    lookup_keysyms(dpy, &meta_mask, &switch_mask);
  
!   if(!front) {
!     scr = openscreen("Workbench Screen", DefaultRootWindow(dpy));
!   }
    realizescreens();
  
    initting = 0;
diff -Ncr amiwm/menu.c amiwm0.20pl28-i18n/menu.c
*** amiwm/menu.c	Sat Aug  3 05:26:29 1996
--- amiwm0.20pl28-i18n/menu.c	Sun Feb  1 02:03:23 1998
***************
*** 108,113 ****
--- 108,114 ----
  {
    XSetWindowAttributes attr;
    XWindowAttributes attr2;
+   XFontSetExtents *extent;
    int w, x, y;
    struct Item *item;
    if(menu->win) {
***************
*** 121,128 ****
    }
    menu->width=menu->height=0;
    for(item=menu->firstitem; item; item=item->next) {
!     if(item->text)
        menu->height+=scr->dri.dri_Font->ascent+scr->dri.dri_Font->descent+1;
      else
        menu->height+=6;
      w=XTextWidth(scr->dri.dri_Font, item->text, item->textlen)+2;
--- 122,135 ----
    }
    menu->width=menu->height=0;
    for(item=menu->firstitem; item; item=item->next) {
!     if(item->text) {
! #if I18N
!       extent = XExtentsOfFontSet(scr->dri.dri_Font);
!       menu->height+=extent->max_logical_extent.height*5/4+1;
! #else
        menu->height+=scr->dri.dri_Font->ascent+scr->dri.dri_Font->descent+1;
+ #endif
+     }
      else
        menu->height+=6;
      w=XTextWidth(scr->dri.dri_Font, item->text, item->textlen)+2;
***************
*** 149,155 ****
--- 156,168 ----
    XSelectInput(dpy, menu->parent, ExposureMask);
    w=1;
    for(item=menu->firstitem; item; item=item->next) {
+ #ifdef I18N
+     int h;
+     extent = XExtentsOfFontSet(scr->dri.dri_Font);
+     h=(item->text? extent->max_logical_extent.height*5/4+1:6);
+ #else
      int h=(item->text? scr->dri.dri_Font->ascent+scr->dri.dri_Font->descent+1:6);
+ #endif
      item->win=XCreateWindow(dpy, menu->parent, 3, w, menu->width-6, h, 0,
  			    CopyFromParent, InputOutput, CopyFromParent,
  			    CWOverrideRedirect|CWBackPixel, &attr);
***************
*** 229,247 ****
--- 242,276 ----
  
  void redraw_menu(struct Menu *m, Window w)
  {
+   XFontSetExtents *extent;
    int active=(m==activemenu && !(m->flags & DISABLED));
    XSetForeground(dpy, scr->menubargc, scr->dri.dri_Pens[active?BARBLOCKPEN:
  					      BARDETAILPEN]);
    XSetBackground(dpy, scr->menubargc, scr->dri.dri_Pens[active?BARDETAILPEN:
  					      BARBLOCKPEN]);
+ #ifdef I18N
+   extent = XExtentsOfFontSet(scr->dri.dri_Font);
+   XmbDrawImageString(dpy, w, scr->dri.dri_Font, scr->menubargc,
+ 		     4, 1+extent->max_logical_extent.height,
+ 		     m->title, m->titlelen);
+ #else
    XDrawImageString(dpy, w, scr->menubargc, 4, 1+scr->dri.dri_Font->ascent,
  		   m->title, m->titlelen);
+ #endif
  }
  
  void redraw_item(struct Item *i, Window w)
  {
+   XFontSetExtents *extent;
    struct Menu *m=i->menu;
+ #if I18N
+   int s, h;
+   extent = XExtentsOfFontSet(scr->dri.dri_Font);
+   h=extent->max_logical_extent.height >> 1;
+   s=h >> 1;
+ #else
    int s=scr->dri.dri_Font->ascent>>1;
+ #endif
    if((i==activeitem || i==activesubitem) && !(i->flags&DISABLED)) {
      XSetForeground(dpy, scr->menubargc, scr->dri.dri_Pens[BARBLOCKPEN]);
      XSetBackground(dpy, scr->menubargc, scr->dri.dri_Pens[BARDETAILPEN]);
***************
*** 249,282 ****
      XSetForeground(dpy, scr->menubargc, scr->dri.dri_Pens[BARDETAILPEN]);
      XSetBackground(dpy, scr->menubargc, scr->dri.dri_Pens[BARBLOCKPEN]);
    }
!   if(i->text)
      XDrawImageString(dpy, w, scr->menubargc, (i->flags&CHECKIT)?1+scr->checkmarkspace:1,
  		     scr->dri.dri_Font->ascent+1, i->text, i->textlen);
    else
      XFillRectangle(dpy, w, scr->menubargc, 2, 2, m->width-10, 2);
    if(i->sub) {
      int x=m->width-6-scr->hotkeyspace-1+8;
      XDrawImageString(dpy, w, scr->menubargc, x+scr->dri.dri_Font->ascent+1,
  		     1+scr->dri.dri_Font->ascent, "»", 1);
    } else if(i->hotkey) {
      int x=m->width-6-scr->hotkeyspace-1+8;
      XDrawLine(dpy, w, scr->menubargc, x, 1+s, x+s, 1);
      XDrawLine(dpy, w, scr->menubargc, x+s, 1, x+s+s, 1+s);
      XDrawLine(dpy, w, scr->menubargc, x+s+s, 1+s, x+s, 1+s+s);
      XDrawLine(dpy, w, scr->menubargc, x+s, 1+s+s, x, 1+s);
      XDrawImageString(dpy, w, scr->menubargc, x+scr->dri.dri_Font->ascent+1,
  		     1+scr->dri.dri_Font->ascent, &i->hotkey, 1);
    }
    if(i->flags&CHECKED) {
      XDrawLine(dpy, w, scr->menubargc, 0, s, s, scr->dri.dri_Font->ascent);
      XDrawLine(dpy, w, scr->menubargc, s, scr->dri.dri_Font->ascent, s+s, 0);
    }
    if(i->flags&DISABLED) {
      XSetStipple(dpy, scr->menubargc, scr->disabled_stipple);
      XSetFillStyle(dpy, scr->menubargc, FillStippled);
      XSetForeground(dpy, scr->menubargc, scr->dri.dri_Pens[BARBLOCKPEN]);
      XFillRectangle(dpy, w, scr->menubargc, 0, 0,
  		   m->width-6, scr->dri.dri_Font->ascent+scr->dri.dri_Font->descent+1);
      XSetFillStyle(dpy, scr->menubargc, FillSolid);
    }
  }
--- 278,339 ----
      XSetForeground(dpy, scr->menubargc, scr->dri.dri_Pens[BARDETAILPEN]);
      XSetBackground(dpy, scr->menubargc, scr->dri.dri_Pens[BARBLOCKPEN]);
    }
!   if(i->text) {
! #ifdef I18N
!     XmbDrawImageString(dpy, w, scr->dri.dri_Font,scr->menubargc,
! 		       (i->flags&CHECKIT)?1+scr->checkmarkspace:1,
! 		       h+1, i->text, i->textlen);
! #else
      XDrawImageString(dpy, w, scr->menubargc, (i->flags&CHECKIT)?1+scr->checkmarkspace:1,
  		     scr->dri.dri_Font->ascent+1, i->text, i->textlen);
+ #endif
+   }
    else
      XFillRectangle(dpy, w, scr->menubargc, 2, 2, m->width-10, 2);
    if(i->sub) {
      int x=m->width-6-scr->hotkeyspace-1+8;
+ #ifdef I18N
+     XmbDrawImageString(dpy, w, scr->dri.dri_Font, scr->menubargc,
+ 		       x+h+1, 1+h, "»", 1);
+ #else
      XDrawImageString(dpy, w, scr->menubargc, x+scr->dri.dri_Font->ascent+1,
  		     1+scr->dri.dri_Font->ascent, "»", 1);
+ #endif
    } else if(i->hotkey) {
      int x=m->width-6-scr->hotkeyspace-1+8;
      XDrawLine(dpy, w, scr->menubargc, x, 1+s, x+s, 1);
      XDrawLine(dpy, w, scr->menubargc, x+s, 1, x+s+s, 1+s);
      XDrawLine(dpy, w, scr->menubargc, x+s+s, 1+s, x+s, 1+s+s);
      XDrawLine(dpy, w, scr->menubargc, x+s, 1+s+s, x, 1+s);
+ #ifdef I18N
+     XmbDrawImageString(dpy, w, scr->dri.dri_Font, scr->menubargc,
+ 		       x+h+1,
+ 		       1+h, &i->hotkey, 1);
+ #else
      XDrawImageString(dpy, w, scr->menubargc, x+scr->dri.dri_Font->ascent+1,
  		     1+scr->dri.dri_Font->ascent, &i->hotkey, 1);
+ #endif
    }
    if(i->flags&CHECKED) {
+ #ifdef I18N
+     XDrawLine(dpy, w, scr->menubargc, 0, s, s, h);
+     XDrawLine(dpy, w, scr->menubargc, s, h, s+s, 0);
+ #else
      XDrawLine(dpy, w, scr->menubargc, 0, s, s, scr->dri.dri_Font->ascent);
      XDrawLine(dpy, w, scr->menubargc, s, scr->dri.dri_Font->ascent, s+s, 0);
+ #endif
    }
    if(i->flags&DISABLED) {
      XSetStipple(dpy, scr->menubargc, scr->disabled_stipple);
      XSetFillStyle(dpy, scr->menubargc, FillStippled);
      XSetForeground(dpy, scr->menubargc, scr->dri.dri_Pens[BARBLOCKPEN]);
+ #ifdef I18N
+     XFillRectangle(dpy, w, scr->menubargc, 0, 0,
+ 		   m->width-6, s*5/4+1);
+ #else
      XFillRectangle(dpy, w, scr->menubargc, 0, 0,
  		   m->width-6, scr->dri.dri_Font->ascent+scr->dri.dri_Font->descent+1);
+ #endif
      XSetFillStyle(dpy, scr->menubargc, FillSolid);
    }
  }
***************
*** 287,292 ****
--- 344,350 ----
    struct Menu *m, *sm1, *sm2, *sm3;
    struct ToolItem *ti;
    GC gc;
+   XFontSetExtents *extent;
  
    scr->firstmenu = NULL;
    attr.override_redirect=True;
***************
*** 317,333 ****
--- 375,401 ----
    XDrawPoint(dpy, scr->disabled_stipple, gc, 3, 1);
    XFreeGC(dpy, gc);
    scr->menubargc=XCreateGC(dpy, scr->menubar, 0, NULL); 
+ #ifndef I18N
    XSetFont(dpy, scr->menubargc, scr->dri.dri_Font->fid);
+ #endif
    XSetBackground(dpy, scr->menubargc, scr->dri.dri_Pens[BARBLOCKPEN]);
    XSelectInput(dpy, scr->menubar, ExposureMask|ButtonPressMask|ButtonReleaseMask);
    XSelectInput(dpy, scr->menubardepth, ExposureMask|ButtonPressMask|
  	       ButtonReleaseMask|EnterWindowMask|LeaveWindowMask);
    XMapWindow(dpy, scr->menubardepth);
    XMapWindow(dpy, scr->menubar);
+ #ifdef I18N
+   extent = XExtentsOfFontSet(scr->dri.dri_Font);
+   scr->hotkeyspace=8+1+XTextWidth(scr->dri.dri_Font, "$", 1)+
+     extent->max_logical_extent.height;
+   scr->checkmarkspace=4+extent->max_logical_extent.height;
+   scr->subspace=scr->hotkeyspace-extent->max_logical_extent.height;
+ #else
    scr->hotkeyspace=8+1+scr->dri.dri_Font->max_bounds.width+
      scr->dri.dri_Font->ascent;
    scr->checkmarkspace=4+scr->dri.dri_Font->ascent;
    scr->subspace=scr->hotkeyspace-scr->dri.dri_Font->ascent;
+ #endif
    scr->menuleft=4;
    m=add_menu("Workbench", 0);
    add_item(m,"Backdrop",'B',CHECKIT|CHECKED|DISABLED);
***************
*** 400,413 ****
--- 468,489 ----
  {
    struct Menu *m;
    struct Item *item;
+   XFontSetExtents *extent;
  
    if(!w)
      return;
    if(w==scr->menubar) {
      XSetForeground(dpy, scr->menubargc, scr->dri.dri_Pens[BARDETAILPEN]);
      XSetBackground(dpy, scr->menubargc, scr->dri.dri_Pens[BARBLOCKPEN]);
+ #ifdef I18N
+     extent = XExtentsOfFontSet(scr->dri.dri_Font);
+     XmbDrawImageString(dpy, w, scr->dri.dri_Font, scr->menubargc, 4,
+ 		       1+extent->max_logical_extent.height,
+ 		       scr->title, strlen(scr->title));
+ #else
      XDrawImageString(dpy, w, scr->menubargc, 4, 1+scr->dri.dri_Font->ascent,
  		     scr->title, strlen(scr->title));
+ #endif
      XSetForeground(dpy, scr->menubargc, scr->dri.dri_Pens[BARTRIMPEN]);  
      XDrawLine(dpy, w, scr->menubargc, 0, scr->bh-1, scr->width-1, scr->bh-1);
    } else if(w==scr->menubardepth) {
diff -Ncr amiwm/requestchoice.c amiwm0.20pl28-i18n/requestchoice.c
*** amiwm/requestchoice.c	Wed Jul 31 20:38:51 1996
--- amiwm0.20pl28-i18n/requestchoice.c	Sat Jan 31 23:21:27 1998
***************
*** 83,88 ****
--- 83,89 ----
  
  void addline(const char *txt)
  {
+   XFontSetExtents *extent;
    struct line *l=myalloc(sizeof(struct line));
    if(lastline)
      lastline->next=l;
***************
*** 91,97 ****
--- 92,103 ----
    lastline=l;
    l->l=strlen(l->text=txt);
    l->w=XTextWidth(dri.dri_Font, l->text, l->l);
+ #ifdef I18N
+   extent = XExtentsOfFontSet(dri.dri_Font);
+   toth+=l->h=extent->max_logical_extent.height/4;
+ #else
    toth+=l->h=dri.dri_Font->ascent+dri.dri_Font->descent;
+ #endif
    if(l->w>maxw)
      maxw=l->w;
  }
***************
*** 99,109 ****
--- 105,127 ----
  void refresh_text()
  {
    int w=totw-BUT_EXTSPACE-BUT_EXTSPACE;
+ #ifdef I18N
+   XFontSetExtents *extent;
+   int h, x, y;
+   struct line *l;
+   extent = XExtentsOfFontSet(dri.dri_Font);
+   h=toth-TXT_TOPSPACE-TXT_MIDSPACE-TXT_BOTSPACE-BUT_VSPACE-
+     extent->max_logical_extent.height*5/4;
+   x=(totw-maxw+TXT_HSPACE)>>1;
+   y=((extent->max_logical_extent.height*5/4)>>1)+
+     extent->max_logical_extent.height;
+ #else
    int h=toth-TXT_TOPSPACE-TXT_MIDSPACE-TXT_BOTSPACE-BUT_VSPACE-
      (dri.dri_Font->ascent+dri.dri_Font->descent);
    int x=(totw-maxw+TXT_HSPACE)>>1;
    int y=((dri.dri_Font->ascent+dri.dri_Font->descent)>>1)+dri.dri_Font->ascent;
    struct line *l;
+ #endif
    XSetForeground(dpy, gc, dri.dri_Pens[SHADOWPEN]);
    XDrawLine(dpy, textwin, gc, 0, 0, w-2, 0);
    XDrawLine(dpy, textwin, gc, 0, 0, 0, h-2);
***************
*** 112,129 ****
--- 130,164 ----
    XDrawLine(dpy, textwin, gc, w-1, 0, w-1, h-1);  
    XSetForeground(dpy, gc, dri.dri_Pens[TEXTPEN]);
    for(l=firstline; l; l=l->next) {
+ #ifdef I18N
+     XmbDrawString(dpy, textwin, dri.dri_Font, gc, x, y, l->text, l->l);
+     y+=extent->max_logical_extent.height*5/4;
+ #else
      XDrawString(dpy, textwin, gc, x, y, l->text, l->l);
      y+=dri.dri_Font->ascent+dri.dri_Font->descent;
+ #endif
    }
  }
  
  void refresh_choice(struct choice *c)
  {
    int w=c->w+BUT_BUTSPACE;
+ #ifdef I18N
+   XFontSetExtents *extent;
+   int h;
+   extent = XExtentsOfFontSet(dri.dri_Font);
+   h=extent->max_logical_extent.height*5/4+BUT_VSPACE;
+ #else
    int h=dri.dri_Font->ascent+dri.dri_Font->descent+BUT_VSPACE;
+ #endif
    XSetForeground(dpy, gc, dri.dri_Pens[TEXTPEN]);
+ #ifdef I18N
+   XmbDrawString(dpy, c->win, dri.dri_Font, gc, BUT_BUTSPACE/2,
+ 		extent->max_logical_extent.height+BUT_VSPACE/2, c->text, c->l);
+ #else
    XDrawString(dpy, c->win, gc, BUT_BUTSPACE/2,
  	      dri.dri_Font->ascent+BUT_VSPACE/2, c->text, c->l);
+ #endif
    XSetForeground(dpy, gc, dri.dri_Pens[(c==selected && depressed)?
  				     SHADOWPEN:SHINEPEN]);
    XDrawLine(dpy, c->win, gc, 0, 0, w-2, 0);
***************
*** 194,199 ****
--- 229,235 ----
    int x, y, extra=0, n=0;
    struct choice *c;
    Argtype array[3], *atp;
+   XFontSetExtents *extent;
  
    progname=argv[0];
    initargs(argc, argv);
***************
*** 216,223 ****
--- 252,265 ----
      split(atp->ptr, "|\n", addchoice);
  
    totw+=BUT_EXTSPACE+BUT_EXTSPACE+BUT_INTSPACE*(nchoices-1);
+ #ifdef I18N
+   extent = XExtentsOfFontSet(dri.dri_Font);
+   toth+=2*(extent->max_logical_extent.height*5/4)+TXT_TOPSPACE+
+     TXT_MIDSPACE+TXT_BOTSPACE+BUT_VSPACE;
+ #else
    toth+=2*(dri.dri_Font->ascent+dri.dri_Font->descent)+TXT_TOPSPACE+
      TXT_MIDSPACE+TXT_BOTSPACE+BUT_VSPACE;
+ #endif
    maxw+=TXT_HSPACE+BUT_EXTSPACE+BUT_EXTSPACE;
  
    if(maxw>totw) {
***************
*** 230,236 ****
--- 272,280 ----
  			      dri.dri_Pens[BACKGROUNDPEN]);
    gc=XCreateGC(dpy, mainwin, 0, NULL);
    XSetBackground(dpy, gc, dri.dri_Pens[BACKGROUNDPEN]);
+ #ifndef I18N
    XSetFont(dpy, gc, dri.dri_Font->fid);
+ #endif
    stipple=XCreatePixmap(dpy, mainwin, 2, 2, attr.depth);
    XSetForeground(dpy, gc, dri.dri_Pens[BACKGROUNDPEN]);
    XFillRectangle(dpy, stipple, gc, 0, 0, 2, 2);
***************
*** 238,253 ****
--- 282,320 ----
    XDrawPoint(dpy, stipple, gc, 0, 1);
    XDrawPoint(dpy, stipple, gc, 1, 0);
    XSetWindowBackgroundPixmap(dpy, mainwin, stipple);
+ #ifdef I18N
+   textwin=XCreateSimpleWindow(dpy, mainwin, BUT_EXTSPACE, TXT_TOPSPACE, totw-
+ 			      BUT_EXTSPACE-BUT_EXTSPACE, toth-TXT_TOPSPACE-
+ 			      TXT_MIDSPACE-TXT_BOTSPACE-BUT_VSPACE-
+ 			      (extent->max_logical_extent.height*5/4),
+ 			      0, dri.dri_Pens[SHADOWPEN],
+ 			      dri.dri_Pens[BACKGROUNDPEN]);
+ #else
    textwin=XCreateSimpleWindow(dpy, mainwin, BUT_EXTSPACE, TXT_TOPSPACE, totw-
  			      BUT_EXTSPACE-BUT_EXTSPACE, toth-TXT_TOPSPACE-
  			      TXT_MIDSPACE-TXT_BOTSPACE-BUT_VSPACE-
  			      (dri.dri_Font->ascent+dri.dri_Font->descent),
  			      0, dri.dri_Pens[SHADOWPEN],
  			      dri.dri_Pens[BACKGROUNDPEN]);
+ #endif
    XSelectInput(dpy, textwin, ExposureMask);
    x=BUT_EXTSPACE;
+ #ifdef I18N
+   y=toth-TXT_BOTSPACE-(extent->max_logical_extent.height*5/4)-BUT_VSPACE;
+ #else
    y=toth-TXT_BOTSPACE-(dri.dri_Font->ascent+dri.dri_Font->descent)-BUT_VSPACE;
+ #endif
    for(c=firstchoice; c; c=c->next) {
+ #ifdef I18N
+     c->win=XCreateSimpleWindow(dpy, mainwin,
+ 			       x+(nchoices==1? (extra>>1):
+ 				  n++*extra/(nchoices-1)),
+ 			       y, c->w+BUT_BUTSPACE,
+ 			       extent->max_logical_extent.height*5/4+
+ 			       BUT_VSPACE, 0,
+ 			       dri.dri_Pens[SHADOWPEN],
+ 			       dri.dri_Pens[BACKGROUNDPEN]);
+ #else
      c->win=XCreateSimpleWindow(dpy, mainwin,
  			       x+(nchoices==1? (extra>>1):
  				  n++*extra/(nchoices-1)),
***************
*** 256,261 ****
--- 323,329 ----
  			       BUT_VSPACE, 0,
  			       dri.dri_Pens[SHADOWPEN],
  			       dri.dri_Pens[BACKGROUNDPEN]);
+ #endif
      XSelectInput(dpy, c->win, ExposureMask|ButtonPressMask|ButtonReleaseMask|
  		 EnterWindowMask|LeaveWindowMask);
      x+=c->w+BUT_BUTSPACE+BUT_INTSPACE;
diff -Ncr amiwm/screen.c amiwm0.20pl28-i18n/screen.c
*** amiwm/screen.c	Sat Apr 27 03:05:32 1996
--- amiwm0.20pl28-i18n/screen.c	Sun Feb  1 02:45:47 1998
***************
*** 10,16 ****
--- 10,21 ----
  
  extern Display *dpy;
  extern Cursor wm_curs;
+ #ifdef I18N
+ extern XFontSet labelfont;
+ #else
  extern XFontStruct *labelfont;
+ #endif
+ 
  extern char *progname;
  extern XContext screen_context;
  
***************
*** 106,111 ****
--- 111,120 ----
    XSetWindowAttributes swa;
    XGCValues gcv;
    extern char *label_font_name;
+   XFontSetExtents *extent;
+   int  missing_charset_count;
+   char **missing_charset_list;
+   char *def_string;
  
    if(!root)
      root = DefaultRootWindow(dpy);
***************
*** 138,157 ****
    XSaveContext(dpy, s->back, screen_context, (XPointer)s);
  
    gcv.background = s->dri.dri_Pens[BACKGROUNDPEN];
    gcv.font = s->dri.dri_Font->fid;
  
    s->gc = XCreateGC(dpy, s->back, GCBackground|GCFont, &gcv);
    
!   if(!labelfont)
      if(!(labelfont = XLoadQueryFont(dpy, label_font_name))) {
        fprintf(stderr, "%s: cannot open font %s\n", progname, label_font_name);
        labelfont = s->dri.dri_Font;
      }
  
    gcv.font = labelfont->fid;
    gcv.foreground = s->dri.dri_Pens[TEXTPEN];
  
    s->icongc = XCreateGC(dpy, s->back, GCForeground|GCBackground|GCFont, &gcv);
  
    gcv.function = GXinvert;
    gcv.subwindow_mode = IncludeInferiors;
--- 147,185 ----
    XSaveContext(dpy, s->back, screen_context, (XPointer)s);
  
    gcv.background = s->dri.dri_Pens[BACKGROUNDPEN];
+ #ifdef I18N
+   s->gc = XCreateGC(dpy, s->back, GCBackground, &gcv);
+ #else
    gcv.font = s->dri.dri_Font->fid;
  
    s->gc = XCreateGC(dpy, s->back, GCBackground|GCFont, &gcv);
+ #endif
    
!   if(!labelfont) {
! #ifdef I18N
!     fprintf(stderr, "fontset: %s\n", label_font_name);
!     if(!(labelfont = XCreateFontSet(dpy, label_font_name,
! 	    &missing_charset_list, &missing_charset_count,&def_string))) {
!       fprintf(stderr, "%s: cannot open font %s\n", progname, label_font_name);
!       labelfont = s->dri.dri_Font;
!     }
! #else
      if(!(labelfont = XLoadQueryFont(dpy, label_font_name))) {
        fprintf(stderr, "%s: cannot open font %s\n", progname, label_font_name);
        labelfont = s->dri.dri_Font;
      }
+ #endif
+   }
+ #ifdef I18N
+   gcv.foreground = s->dri.dri_Pens[TEXTPEN];
  
+   s->icongc = XCreateGC(dpy, s->back, GCForeground|GCBackground, &gcv);
+ #else
    gcv.font = labelfont->fid;
    gcv.foreground = s->dri.dri_Pens[TEXTPEN];
  
    s->icongc = XCreateGC(dpy, s->back, GCForeground|GCBackground|GCFont, &gcv);
+ #endif
  
    gcv.function = GXinvert;
    gcv.subwindow_mode = IncludeInferiors;
***************
*** 164,170 ****
--- 192,203 ----
    s->default_tool_pm2 = None;
    s->default_tool_pm_w=0;
    s->default_tool_pm_h=0;
+ #ifdef I18N
+   extent = XExtentsOfFontSet(labelfont);
+   s->lh = extent->max_logical_extent.height*5/4;
+ #else
    s->lh = labelfont->ascent+labelfont->descent;
+ #endif
  
    if(front) {
      s->behind=front;
***************
*** 184,194 ****
  void realizescreens(void)
  {
    Scrn *s2;
! 
    scr = front;
  
    do {
      scr->fh = scr->dri.dri_Font->ascent+scr->dri.dri_Font->descent;
      scr->bh=scr->fh+3;
      scr->h2=(2*scr->bh)/10; scr->h3=(3*scr->bh)/10;
      scr->h4=(4*scr->bh)/10; scr->h5=(5*scr->bh)/10;
--- 217,234 ----
  void realizescreens(void)
  {
    Scrn *s2;
! #ifdef I18N
!   XFontSetExtents *extent;
! #endif
    scr = front;
  
    do {
+ #ifdef I18N
+     extent = XExtentsOfFontSet(scr->dri.dri_Font);
+     scr->fh = extent->max_logical_extent.height*5/4;
+ #else
      scr->fh = scr->dri.dri_Font->ascent+scr->dri.dri_Font->descent;
+ #endif
      scr->bh=scr->fh+3;
      scr->h2=(2*scr->bh)/10; scr->h3=(3*scr->bh)/10;
      scr->h4=(4*scr->bh)/10; scr->h5=(5*scr->bh)/10;
