diff -c ../tk3.2/Makefile ./Makefile
*** ../tk3.2/Makefile	Thu Feb 11 08:53:10 1993
--- ./Makefile	Mon Apr 12 01:58:42 1993
***************
*** 47,61 ****
  # To compile under OpenWindows, uncomment the following line:
  
  # OW =		-I/usr/openwin/include -L/usr/openwin/lib
  CC		= cc
! CFLAGS		= -I. -I$(TCL_DIR) -O -DTK_LIBRARY=\"${TK_LIBRARY}\" \
! 	${NP} ${OW}
  
  LIBS = libtk.a $(TCL_DIR)/libtcl.a
  
  WIDGOBJS = tkButton.o tkEntry.o tkFrame.o tkListbox.o \
  	tkMenu.o tkMenubutton.o tkMessage.o tkScale.o \
! 	tkScrollbar.o
  
  CANVOBJS = tkCanvas.o tkCanvArc.o tkCanvBmap.o tkCanvLine.o \
  	tkCanvPoly.o tkCanvPs.o tkCanvText.o tkCanvWind.o \
--- 47,66 ----
  # To compile under OpenWindows, uncomment the following line:
  
  # OW =		-I/usr/openwin/include -L/usr/openwin/lib
+ 
+ # for Ultrix cc
+ 
+ ULT = -Olimit 2000
+ 
  CC		= cc
! CFLAGS		= -g -I. -I$(TCL_DIR) -O -DTK_LIBRARY=\"${TK_LIBRARY}\" \
! 	${NP} ${OW} ${ULT} -DFONT16
  
  LIBS = libtk.a $(TCL_DIR)/libtcl.a
  
  WIDGOBJS = tkButton.o tkEntry.o tkFrame.o tkListbox.o \
  	tkMenu.o tkMenubutton.o tkMessage.o tkScale.o \
! 	tkScrollbar.o tkXText16.o
  
  CANVOBJS = tkCanvas.o tkCanvArc.o tkCanvBmap.o tkCanvLine.o \
  	tkCanvPoly.o tkCanvPs.o tkCanvText.o tkCanvWind.o \
***************
*** 73,79 ****
  WIDGSRCS = tkButton.c tkEntry.c tkFrame.c tkListbox.c \
  	tkMenu.c tkMenubutton.c tkMessage.c tkScale.c \
  	tkScrollbar.c tkText.c tkTextBTree.c tkTextDisp.c \
! 	tkTextIndex.c
  
  CANVSRCS = tkCanvas.c tkCanvArc.c tkCanvBmap.c tkCanvLine.c \
  	tkCanvPoly.c tkCanvPs.c tkCanvText.c tkCanvWind.c \
--- 78,84 ----
  WIDGSRCS = tkButton.c tkEntry.c tkFrame.c tkListbox.c \
  	tkMenu.c tkMenubutton.c tkMessage.c tkScale.c \
  	tkScrollbar.c tkText.c tkTextBTree.c tkTextDisp.c \
! 	tkTextIndex.c tkXText16.c
  
  CANVSRCS = tkCanvas.c tkCanvArc.c tkCanvBmap.c tkCanvLine.c \
  	tkCanvPoly.c tkCanvPs.c tkCanvText.c tkCanvWind.c \
Only in .: Makefile.maple
Only in .: README.16bit
Common subdirectories: ../tk3.2/bitmaps and ./bitmaps
Common subdirectories: ../tk3.2/doc and ./doc
Common subdirectories: ../tk3.2/library and ./library
Only in .: patch-16bit
Common subdirectories: ../tk3.2/tcl and ./tcl
Common subdirectories: ../tk3.2/tests and ./tests
diff -c ../tk3.2/tkButton.c ./tkButton.c
*** ../tk3.2/tkButton.c	Fri Jan 22 09:51:46 1993
--- ./tkButton.c	Sun Apr  4 18:34:42 1993
***************
*** 15,20 ****
--- 15,21 ----
   * software for any purpose.  It is provided "as is" without
   * express or implied warranty.
   */
+ /* modified by K.Furukawa, Kek, Apr.1.1993. for 16bit font */
  
  #ifndef lint
  static char rcsid[] = "$Header: /user6/ouster/wish/RCS/tkButton.c,v 1.73 93/01/21 16:51:44 ouster Exp $ SPRITE (Berkeley)";
***************
*** 1054,1060 ****
--- 1055,1065 ----
  	    x += 1;
  	    y += 1;
  	}
+ #ifdef FONT16					/* for 16bit font */
+ 	TkXDrawString(butPtr->fontPtr, butPtr->display, pixmap, gc, x, y,
+ #else
  	XDrawString(butPtr->display, pixmap, gc, x, y,
+ #endif
  		butPtr->text, butPtr->textLength);
  	y -= (butPtr->fontPtr->ascent - butPtr->fontPtr->descent)/2;
  	x -= butPtr->leftBearing;
diff -c ../tk3.2/tkCanvText.c ./tkCanvText.c
*** ../tk3.2/tkCanvText.c	Fri Jan  8 10:29:41 1993
--- ./tkCanvText.c	Sun Apr 11 02:47:46 1993
***************
*** 12,17 ****
--- 12,18 ----
   * software for any purpose.  It is provided "as is" without
   * express or implied warranty.
   */
+ /* modified by K.Furukawa, Kek, Apr.1.1993. for 16bit font */
  
  #ifndef lint
  static char rcsid[] = "$Header: /user6/ouster/wish/RCS/tkCanvText.c,v 1.19 93/01/07 17:29:34 ouster Exp $ SPRITE (Berkeley)";
***************
*** 848,853 ****
--- 849,862 ----
  	beforeThis = textPtr->numChars;
      }
  
+ #ifdef FONT16					/* for 16bit font */
+     {
+ 	int flag = 0;
+ 	if (TkCanvasFont16Check(textPtr))  {
+ 	    string = TkAllocChars16(string, &length);
+ 	    flag++;
+ 	}
+ #endif /* FONT16 */
      new = (char *) ckalloc((unsigned) (textPtr->numChars + length + 1));
      strncpy(new, textPtr->text, beforeThis);
      strcpy(new+beforeThis, string);
***************
*** 855,860 ****
--- 864,875 ----
      ckfree(textPtr->text);
      textPtr->text = new;
      textPtr->numChars += length;
+ #ifdef FONT16					/* for 16bit font */
+ 	if (flag)  {
+ 	    TkFreeChars16(string);
+ 	}
+     }
+ #endif /* FONT16 */
  
      /*
       * Inserting characters invalidates indices such as those for the
***************
*** 909,914 ****
--- 924,936 ----
      int count;
      char *new;
  
+ #ifdef FONT16					/* for 16bit font */
+     if (TkCanvasFont16Check(textPtr))  {
+ 	first &= ~1;				/* even number */
+ 	if (!(last & 1))
+ 	    last++;				/* odd number */
+     }
+ #endif /* FONT16 */
      if (first < 0) {
  	first = 0;
      }
***************
*** 1516,1518 ****
--- 1538,1556 ----
      buffer[used+1] = 0;
      Tcl_AppendResult(interp, buffer, (char *) NULL);
  }
+ 
+ #ifdef FONT16					/* for 16bit font */
+ 
+ /* TkCanvasFont16Check  --  check if the font is 8bit or 16bit */
+ 
+ /* this function is here since TextItem structure is defined in this file */
+ 
+ int
+ TkCanvasFont16Check(itemPtr)
+     Tk_Item *itemPtr;
+ {
+     TextItem *textPtr = (TextItem *) itemPtr;
+ 
+     return TkFont16Check(textPtr->fontPtr);
+ }
+ #endif /* FONT16 */
diff -c ../tk3.2/tkCanvas.c ./tkCanvas.c
*** ../tk3.2/tkCanvas.c	Fri Jan 22 09:51:56 1993
--- ./tkCanvas.c	Tue Apr  6 21:55:41 1993
***************
*** 14,19 ****
--- 14,20 ----
   * software for any purpose.  It is provided "as is" without
   * express or implied warranty.
   */
+ /* modified by K.Furukawa, Kek, Apr.1.1993. for 16bit font */
  
  #ifndef lint
  static char rcsid[] = "$Header: /user6/ouster/wish/RCS/tkCanvas.c,v 1.39 93/01/21 16:51:52 ouster Exp $ SPRITE (Berkeley)";
***************
*** 2960,2965 ****
--- 2961,2972 ----
      if (canvasPtr->selectAnchor <= index) {
  	canvasPtr->selectFirst = canvasPtr->selectAnchor;
  	canvasPtr->selectLast = index;
+ #ifdef FONT16					/* for 16bit font */
+ 	if (TkCanvasFont16Check(itemPtr))  {
+ 	    /* selectLast must be odd number for width to be even number */
+ 	    if (!(index & 1))  canvasPtr->selectLast = index-1;
+ 	}
+ #endif
      } else {
  	canvasPtr->selectFirst = index;
  	canvasPtr->selectLast = canvasPtr->selectAnchor - 1;
diff -c ../tk3.2/tkConfig.h ./tkConfig.h
*** ../tk3.2/tkConfig.h	Fri Jan 29 09:10:36 1993
--- ./tkConfig.h	Tue Apr  6 22:18:45 1993
***************
*** 16,25 ****
--- 16,34 ----
   *
   * $Header: /user6/ouster/wish/RCS/tkConfig.h,v 1.16 93/01/28 16:10:25 ouster Exp $ SPRITE (Berkeley)
   */
+ /* modified by K.Furukawa, Kek, Apr.1.1993. for 16bit font */
  
  #ifndef _TKCONFIG
  #define _TKCONFIG
  
+ #ifdef FONT16
+ /* in order to prevent isspace from redefining */
+ /* tkInt.h may define isspace already */
+ #ifdef isspace
+ #undef isspace
+ #endif
+ #endif
+ 
  /*
   * Macro to use instead of "void" for arguments that must have
   * type "void *" in ANSI C;  maps them to type "char *" in
***************
*** 121,125 ****
--- 130,144 ----
  extern int		select _ANSI_ARGS_((int nfds, SELECT_MASK *readfds,
  			    SELECT_MASK *writefds, SELECT_MASK *exceptfds,
  			    struct timeval *timeout));
+ 
+ #ifdef FONT16					/* for 16bit font */
+ /* isspace definition is included also in tkInt.h in order to be
+    independent of the order of tkConfig.h and tkInt.h */
+ #ifdef isspace
+ #undef isspace
+ #endif /* isspace */
+ #define isspace(a) Tkisspace(a)
+ extern int		Tkisspace _ANSI_ARGS_((char a));
+ #endif /* FONT16 */
  
  #endif /* _TKCONFIG */
diff -c ../tk3.2/tkEntry.c ./tkEntry.c
*** ../tk3.2/tkEntry.c	Tue Feb  2 08:47:47 1993
--- ./tkEntry.c	Mon Apr 12 00:35:32 1993
***************
*** 14,19 ****
--- 14,20 ----
   * software for any purpose.  It is provided "as is" without
   * express or implied warranty.
   */
+ /* modified by K.Furukawa, Kek, Apr.1.1993. for 16bit font */
  
  #ifndef lint
  static char rcsid[] = "$Header: /user6/ouster/wish/RCS/tkEntry.c,v 1.45 93/02/01 15:47:14 ouster Exp $ SPRITE (Berkeley)";
***************
*** 1032,1037 ****
--- 1033,1048 ----
      if (length == 0) {
  	return;
      }
+ #ifdef FONT16					/* for 16bit font */
+     /* this procedure converts alphanumeric characters to 16bit
+        equivalent. */
+     {				
+ 	int flag = 0;
+ 	if ((length == 1) && TkFont16Check(entryPtr->fontPtr))  {
+ 	    flag++;
+ 	    string = TkAllocChars16(string, &length);	/* cnvt into 16bit*/
+ 	}
+ #endif /* FONT16 */
      new = (char *) ckalloc((unsigned) (entryPtr->numChars + length + 1));
      strncpy(new, entryPtr->string, index);
      strcpy(new+index, string);
***************
*** 1039,1044 ****
--- 1050,1061 ----
      ckfree(entryPtr->string);
      entryPtr->string = new;
      entryPtr->numChars += length;
+ #ifdef FONT16					/* for 16bit font */
+ 	if (flag)  {
+ 	    TkFreeChars16(string);
+ 	}
+     }
+ #endif /* FONT16 */
  
      /*
       * Inserting characters invalidates all indexes into the string.
***************
*** 1095,1100 ****
--- 1112,1124 ----
  {
      char *new;
  
+ #ifdef FONT16					/* for 16bit font */
+     if (TkFont16Check(entryPtr->fontPtr))  {
+ 	index &= ~1;				/* even number, 16bit bound. */
+ 	if (count & 1)  count++;		/* 16bit boundary */
+     }
+ #endif /* FONT16 */
+ 
      if ((index + count) > entryPtr->numChars) {
  	count = entryPtr->numChars - index;
      }
***************
*** 1341,1346 ****
--- 1365,1374 ----
  	    *indexPtr = entryPtr->numChars;
  	}
      }
+ #ifdef FONT16					/* for 16bit font */
+     if ((*indexPtr & 1) && (*indexPtr > 0) && TkFont16Check(entryPtr->fontPtr))
+ 	(*indexPtr)--;				/* adjust view for boundary */
+ #endif /* FONT16 */
      return TCL_OK;
  }
  
***************
*** 1391,1396 ****
--- 1419,1428 ----
  	entryPtr->scanMarkX = x;
      } 
      if (newLeftIndex != entryPtr->leftIndex) {
+ #ifdef FONT16					/* for 16bit font */
+ 	if ((newLeftIndex & 1) && TkFont16Check(entryPtr->fontPtr))
+ 	    newLeftIndex--;			/* adjust view for boundary */
+ #endif /* FONT16 */
  	entryPtr->leftIndex = newLeftIndex;
  	EventuallyRedraw(entryPtr);
  	EntryUpdateScrollbar(entryPtr);
***************
*** 1468,1473 ****
--- 1500,1512 ----
  	    return;
  	}
  	entryPtr->selectFirst = newFirst;
+ #ifdef FONT16					/* for 16bit font */
+ 	if (!(newLast & 1) && TkFont16Check(entryPtr->fontPtr))  {
+ 	    newLast--;				/* adjust sel for boundary */
+ 	    if (newFirst == newLast)
+ 		newLast += 2;			/* at least one character */
+ 	}
+ #endif /* FONT16 */
  	entryPtr->selectLast = newLast;
      }
      EventuallyRedraw(entryPtr);
diff -c ../tk3.2/tkFont.c ./tkFont.c
*** ../tk3.2/tkFont.c	Sat Jan  9 01:42:05 1993
--- ./tkFont.c	Sat Apr 10 17:01:12 1993
***************
*** 14,19 ****
--- 14,20 ----
   * software for any purpose.  It is provided "as is" without
   * express or implied warranty.
   */
+ /* modified by K.Furukawa, Kek, Apr.1.1993. for 16bit font */
  
  #ifndef lint
  static char rcsid[] = "$Header: /user6/ouster/wish/RCS/tkFont.c,v 1.22 93/01/08 08:41:59 ouster Exp $ SPRITE (Berkeley)";
***************
*** 481,486 ****
--- 482,508 ----
      int newX;			/* X-position corresponding to p+1. */
      int type;
  
+ 
+ #ifdef FONT16					/* for 16bit font */
+     if (TkFont16Check(fontStructPtr))  {
+ 	/* I could not find a good way to do TkMeasureChars for 16bit font,
+ 	   so I asume every character has the same size. */
+ 	static char kanjiA[] = {0xb0, 0xa1, 0};	/* kanji a */
+ 	int widthA, numchars, numcharn;
+ 	char *cr;
+ 
+ 	widthA = TkXTextWidth(fontStructPtr, kanjiA, 2);
+ 	numchars = ((maxX - startX) / widthA) * 2;
+ 	if (numchars < 0)  numchars = 0;
+ 	if (cr = strchr(source, '\n'))		/* find newline */
+ 	    if ((numcharn = cr - source) < numchars)  numchars = numcharn;
+ 	if (maxChars >= 0 && numchars > maxChars)  numchars = maxChars;
+ 	if (!(numchars) && (flags & TK_AT_LEAST_ONE))  numchars = 2;
+ 	numchars &= ~1;				/* even number */
+ 	*nextXPtr = startX + TkXTextWidth(fontStructPtr, source, numchars);
+ 	return numchars;
+     }
+ #endif /* FONT16 */
      /*
       * Find the TkFont structure for this font, and make sure its
       * font metrics exist.
***************
*** 619,624 ****
--- 641,656 ----
      int curX;			/* X-coordinate corresponding to p. */
      char replace[10];
  
+ #ifdef FONT16					/* for 16bit font */
+     if (TkFont16Check(fontStructPtr))  {
+ 	/* I could not find a good way to do TkDisplayChars for 16bit font,
+ 	   so I merely draw string. */
+ 	TkXDrawString(fontStructPtr, display, drawable, gc, 
+ 			  x, y, string, numChars);
+ 	return;
+     }
+ #endif /* FONT16 */
+ 
      /*
       * Find the TkFont structure for this font, and make sure its
       * font metrics exist.
***************
*** 662,668 ****
--- 694,705 ----
  	    continue;
  	}
  	if (p != start) {
+ #ifdef FONT16					/* for 16bit font */
+ 	    TkXDrawString(fontStructPtr, display, drawable, gc, 
+ 			  startX, y, start, p - start);
+ #else
  	    XDrawString(display, drawable, gc, startX, y, start, p - start);
+ #endif
  	    startX = curX;
  	}
  	if (type == TAB) {
***************
*** 674,680 ****
--- 711,722 ----
  	    replace[1] = 'x';
  	    replace[2] = hexChars[(c >> 4) & 0xf];
  	    replace[3] = hexChars[c & 0xf];
+ #ifdef FONT16					/* for 16bit font */
+ 	    TkXDrawString(fontStructPtr, display, drawable, gc, 
+ 			  startX, y, replace, 4);
+ #else
  	    XDrawString(display, drawable, gc, startX, y, replace, 4);
+ #endif
  	    curX += fontPtr->widths[replace[0]]
  		    + fontPtr->widths[replace[1]]
  		    + fontPtr->widths[replace[2]]
***************
*** 698,704 ****
--- 740,751 ----
       */
  
      if (p != start) {
+ #ifdef FONT16					/* for 16bit font */
+ 	TkXDrawString(fontStructPtr, display, drawable, gc, 
+ 		      startX, y, start, p - start);
+ #else
  	XDrawString(display, drawable, gc, startX, y, start, p - start);
+ #endif
      }
  }
  
***************
*** 764,769 ****
--- 811,822 ----
  
      TkMeasureChars(fontStructPtr, string, firstChar, x, (int) 1000000, flags,
  	    &xUnder);
+ #ifdef FONT16					/* for 16bit font */
+     if (TkFont16Check(fontStructPtr))  {
+ 	if ((lastChar+1-firstChar) & 1)
+ 	    lastChar++;				/* adjust to 16bit boundary */
+     }
+ #endif /* FONT16 */
      TkMeasureChars(fontStructPtr, string+firstChar, lastChar+1-firstChar,
  	    xUnder, (int) 1000000, flags, &width);
      width -= xUnder;
diff -c ../tk3.2/tkInt.h ./tkInt.h
*** ../tk3.2/tkInt.h	Sun Jan 24 09:59:22 1993
--- ./tkInt.h	Sun Apr 11 02:31:32 1993
***************
*** 15,20 ****
--- 15,21 ----
   *
   * $Header: /user6/ouster/wish/RCS/tkInt.h,v 1.84 93/01/23 16:59:14 ouster Exp $ SPRITE (Berkeley)
   */
+ /* modified by K.Furukawa, Kek, Apr.1.1993. for 16bit font */
  
  #ifndef _TKINT
  #define _TKINT
***************
*** 551,555 ****
--- 552,580 ----
  			    XEvent *evenvPtr));
  extern void		TkWmSetClass _ANSI_ARGS_((TkWindow *winPtr));
  extern void		TkWmNewWindow _ANSI_ARGS_((TkWindow *winPtr));
+ 
+ #ifdef FONT16					/* for 16bit font */
+ #define XTextWidth(a,b,c) TkXTextWidth(a,b,c)
+ #define XTextExtents(a,b,c,d,e,f,g) TkXTextExtents(a,b,c,d,e,f,g)
+ #ifdef isspace
+ /* in case some header files include ctype.h */
+ #undef isspace
+ #endif /* isspace */
+ #define isspace(a) Tkisspace(a)
+ 
+ extern char *		TkAllocChars16 _ANSI_ARGS_((char *string,int *length));
+ extern void		TkFreeChars16 _ANSI_ARGS_((char *string));
+ extern int		TkFont16Check _ANSI_ARGS_((XFontStruct *font_struct));
+ extern void		TkXDrawString _ANSI_ARGS_((XFontStruct *font_struct,
+ 			    Display *display, Drawable window, GC gc,
+ 			    int x, int y, char string[], int length));
+ extern int		TkXTextWidth _ANSI_ARGS_((XFontStruct *font_struct,
+ 			    char string[], int length));
+ extern void		TkXTextExtents _ANSI_ARGS_((XFontStruct *font_struct,
+ 			    char string[], int length, int *direction_hint,
+ 			    int *font_ascent, int *font_descent,
+ 			    XCharStruct *overall));
+ 
+ #endif /* FONT16 */
  
  #endif  /* _TKINT */
diff -c ../tk3.2/tkListbox.c ./tkListbox.c
*** ../tk3.2/tkListbox.c	Fri Jan 22 09:51:52 1993
--- ./tkListbox.c	Sun Apr  4 18:34:11 1993
***************
*** 14,19 ****
--- 14,20 ----
   * software for any purpose.  It is provided "as is" without
   * express or implied warranty.
   */
+ /* modified by K.Furukawa, Kek, Apr.1.1993. for 16bit font */
  
  #ifndef lint
  static char rcsid[] = "$Header: /user6/ouster/wish/RCS/tkListbox.c,v 1.62 93/01/21 16:51:48 ouster Exp $ SPRITE (Berkeley)";
***************
*** 868,875 ****
--- 869,881 ----
  	}
  	y += listPtr->fontPtr->ascent + listPtr->selBorderWidth;
  	x += margin - elPtr->lBearing - listPtr->xOffset;
+ #ifdef FONT16					/* for 16bit font */
+ 	TkXDrawString(listPtr->fontPtr, listPtr->display, pixmap, gc, x, y,
+ 		elPtr->text, elPtr->textLength);
+ #else
  	XDrawString(listPtr->display, pixmap, gc, x, y,
  		elPtr->text, elPtr->textLength);
+ #endif
      }
  
      /*
diff -c ../tk3.2/tkMenubutton.c ./tkMenubutton.c
*** ../tk3.2/tkMenubutton.c	Tue Jan 26 09:36:28 1993
--- ./tkMenubutton.c	Sun Apr  4 11:09:56 1993
***************
*** 13,18 ****
--- 13,19 ----
   * software for any purpose.  It is provided "as is" without
   * express or implied warranty.
   */
+ /* modified by K.Furukawa, Kek, Apr.1.1993. for 16bit font */
  
  #ifndef lint
  static char rcsid[] = "$Header: /user6/ouster/wish/RCS/tkMenubutton.c,v 1.37 93/01/21 16:51:57 ouster Exp Locker: ouster $ SPRITE (Berkeley)";
***************
*** 765,772 ****
--- 766,778 ----
  			- mbPtr->fontPtr->descent;
  		break;
  	}
+ #ifdef FONT16					/* for 16bit font */
+ 	TkXDrawString(mbPtr->fontPtr, mbPtr->display, pixmap, gc, x, y, 
+ 		mbPtr->text, mbPtr->textLength);
+ #else
  	XDrawString(mbPtr->display, pixmap, gc, x, y, mbPtr->text,
  		mbPtr->textLength);
+ #endif
  	if (mbPtr->underline >= 0) {
  	    TkUnderlineChars(mbPtr->display, pixmap, gc, mbPtr->fontPtr,
  		    mbPtr->text, x, y, TK_NEWLINES_NOT_SPECIAL,
diff -c ../tk3.2/tkText.c ./tkText.c
*** ../tk3.2/tkText.c	Tue Dec 15 04:18:25 1992
--- ./tkText.c	Sun Apr 11 03:59:08 1993
***************
*** 16,21 ****
--- 16,22 ----
   * software for any purpose.  It is provided "as is" without
   * express or implied warranty.
   */
+ /* modified by K.Furukawa, Kek, Apr.1.1993. for 16bit font */
  
  #ifndef lint
  static char rcsid[] = "$Header: /user6/ouster/wish/RCS/tkText.c,v 1.26 92/12/14 11:18:20 ouster Exp $ SPRITE (Berkeley)";
***************
*** 25,30 ****
--- 26,34 ----
  #include "tkConfig.h"
  #include "tk.h"
  #include "tkText.h"
+ #ifdef FONT16
+ #include "tkInt.h"
+ #endif /* FONT16 */
  
  /*
   * Information used to parse text configuration options:
***************
*** 841,848 ****
--- 845,868 ----
       * the insertion.
       */
  
+ #ifdef FONT16					/* for 16bit font */
+     {
+ 	int flag = 0;
+ 	if (TkTextFont16Check(textPtr, line, ch))  {
+ 	    int leng;
+ 	    leng = strlen(string);
+ 	    string = TkAllocChars16(string, &leng);
+ 	    flag++;
+ 	}
+ #endif /* FONT16 */
      TkTextLinesChanged(textPtr, line, line);
      TkBTreeInsertChars(textPtr->tree, linePtr, ch, string);
+ #ifdef FONT16					/* for 16bit font */
+ 	if (flag)  {
+ 	    TkFreeChars16(string);
+ 	}
+     }
+ #endif /* FONT16 */
  
      /*
       * If the line containing the insertion point was textPtr->topLinePtr,
***************
*** 886,891 ****
--- 906,915 ----
  {
      register TkTextLine *line1Ptr, *line2Ptr;
      int numLines, topLine;
+ 
+ #ifdef FONT16					/* for 16bit font */
+     TkText16Adjust(textPtr, line1, &ch1, line2, &ch2);	/* adjust boundary */
+ #endif /* FONT16 */
  
      /*
       * The loop below is needed because a LeaveNotify event may be
diff -c ../tk3.2/tkText.h ./tkText.h
*** ../tk3.2/tkText.h	Tue Dec 15 04:29:35 1992
--- ./tkText.h	Sun Apr 11 02:31:52 1993
***************
*** 15,20 ****
--- 15,21 ----
   *
   * $Header: /user6/ouster/wish/RCS/tkText.h,v 1.14 92/12/14 11:29:32 ouster Exp $ SPRITE (Berkeley)
   */
+ /* modified by K.Furukawa, Kek, Apr.1.1993. for 16bit font */
  
  #ifndef _TKTEXT
  #define _TKTEXT
***************
*** 413,417 ****
--- 414,427 ----
  extern int		TkTextTagCmd _ANSI_ARGS_((TkText *textPtr,
  			    Tcl_Interp *interp, int argc, char **argv));
  extern void		TkTextUnpickCurrent _ANSI_ARGS_((TkText *textPtr));
+ 
+ #ifdef FONT16					/* for 16bit font */
+ 
+ extern void		TkText16Adjust _ANSI_ARGS_((TkText *textPtr, 
+ 			    int line1, int *ch1, int line2, int *ch2));
+ extern int		TkTextFont16Check _ANSI_ARGS_((TkText *textPtr, 
+ 			    int line, int ch));
+ 
+ #endif /* FONT16 */
  
  #endif /* _TKTEXT */
diff -c ../tk3.2/tkTextDisp.c ./tkTextDisp.c
*** ../tk3.2/tkTextDisp.c	Sun Jan 24 10:42:16 1993
--- ./tkTextDisp.c	Sun Apr 11 02:33:25 1993
***************
*** 14,19 ****
--- 14,20 ----
   * software for any purpose.  It is provided "as is" without
   * express or implied warranty.
   */
+ /* modified by K.Furukawa, Kek, Apr.1.1993. for 16bit font */
  
  #ifndef lint
  static char rcsid[] = "$Header: /user6/ouster/wish/RCS/tkTextDisp.c,v 1.28 93/01/23 17:41:41 ouster Exp $ SPRITE (Berkeley)";
***************
*** 2044,2049 ****
--- 2045,2059 ----
  		count = chunkPtr->numChars-1;
  	    }
  	}
+ #ifdef FONT16					/* for 16bit font */
+ /*	if (TkFont16Check(chunkPtr->stylePtr->sValuePtr->fontPtr))  {
+ /*	    printf("%d ", count);
+ /*	    if ((count) & 1)
+ /*		count--;
+ /*	    printf("%d\n", count);
+ /*	}
+ */
+ #endif /* FONT16 */
  	*chPtr = count + (chunkPtr->text - dlPtr->linePtr->bytes);
  	return dlPtr->linePtr;
      }
***************
*** 2050,2052 ****
--- 2060,2139 ----
      panic("TkTextCharAtLoc ran out of lines");
      return (TkTextLine *) NULL;
  }
+ 
+ #ifdef FONT16					/* for 16bit font */
+ /* TkText16Adjust  --  adjust tag position if the font is 16bit */
+ 
+ void
+ TkText16Adjust(textPtr, line1, ch1, line2, ch2)
+ TkText *textPtr;
+ int line1, line2;
+ int *ch1, *ch2;
+ {
+     DLine *dlPtr;
+     Chunk *chunkPtr;
+     int numch;
+ 
+  first:						/* for first position */
+     if (dlPtr = FindDLine(textPtr->dInfoPtr->dLinePtr, line1))  {
+ 	chunkPtr = dlPtr->chunkPtr;
+ 	numch = chunkPtr->numChars;
+ 	while (numch < *ch1)  {			/* find specified char. */
+ 	    if ((chunkPtr = chunkPtr->nextPtr) == NULL)  {
+ 		textPtr->dInfoPtr->flags |= DINFO_OUT_OF_DATE;
+ 		UpdateDisplayInfo(textPtr);	/* if invalid, update */
+ 		goto first;
+ 	    }
+ 	    numch += chunkPtr->numChars;
+ 	}
+ 	if (TkFont16Check(chunkPtr->stylePtr->sValuePtr->fontPtr))
+ 	    if ((*ch1-numch) & 1)
+ 		(*ch1)--;
+     }
+  second:					/* for second position */
+     if (dlPtr = FindDLine(textPtr->dInfoPtr->dLinePtr, line2))  {
+ 	chunkPtr = dlPtr->chunkPtr;
+ 	numch = chunkPtr->numChars;
+ 	while (numch < *ch2)  {			/* find specified char. */
+ 	    if ((chunkPtr = chunkPtr->nextPtr) == NULL)  {
+ 		textPtr->dInfoPtr->flags |= DINFO_OUT_OF_DATE;
+ 		UpdateDisplayInfo(textPtr);	/* if invalid, update */
+ 		goto second;
+ 	    }
+ 	    numch += chunkPtr->numChars;
+ 	}
+ 	if (TkFont16Check(chunkPtr->stylePtr->sValuePtr->fontPtr))
+ 	    if ((*ch2-numch) & 1)
+ 		(*ch2)--;
+     }
+ }
+ 
+ /* TkTextFont16Check  --  check character if the font is 16bit */
+ 
+ int
+ TkTextFont16Check(textPtr, line, ch)
+ TkText *textPtr;
+ int line;
+ int ch;
+ {
+     DLine *dlPtr;
+     Chunk *chunkPtr;
+     int numch;
+ 
+  start:						/* search position */
+     if (dlPtr = FindDLine(textPtr->dInfoPtr->dLinePtr, line))  {
+ 	chunkPtr = dlPtr->chunkPtr;
+ 	numch = chunkPtr->numChars;
+ 	while (numch < ch)  {			/* find specified char. */
+ 	    if ((chunkPtr = chunkPtr->nextPtr) == NULL)  {
+ 		textPtr->dInfoPtr->flags |= DINFO_OUT_OF_DATE;
+ 		UpdateDisplayInfo(textPtr);	/* if invalid, update */
+ 		goto start;
+ 	    }
+ 	    numch += chunkPtr->numChars;
+ 	}
+ 	return TkFont16Check(chunkPtr->stylePtr->sValuePtr->fontPtr);
+     }
+     return 0;
+ }
+ #endif /* FONT16 */
diff -c ../tk3.2/tkTextTag.c ./tkTextTag.c
*** ../tk3.2/tkTextTag.c	Thu Dec 17 02:59:42 1992
--- ./tkTextTag.c	Fri Apr  9 16:33:41 1993
***************
*** 14,19 ****
--- 14,20 ----
   * software for any purpose.  It is provided "as is" without
   * express or implied warranty.
   */
+ /* modified by K.Furukawa, Kek, Apr.1.1993. for 16bit font */
  
  #ifndef lint
  static char rcsid[] = "$Header: /user6/ouster/wish/RCS/tkTextTag.c,v 1.5 92/12/16 09:59:41 ouster Exp $ SPRITE (Berkeley)";
***************
*** 135,140 ****
--- 136,145 ----
  	    line2 = line1;
  	    ch2 = ch1+1;
  	}
+ #ifdef FONT16					/* for 16bit font */
+ 	/* adjust position if font is 16bit and position is odd */
+ 	(void) TkText16Adjust(textPtr,line1,&ch1,line2,&ch2);
+ #endif
  	if (TK_TAG_AFFECTS_DISPLAY(tagPtr)) {
  	    TkTextRedrawTag(textPtr, line1, ch1, line2, ch2, tagPtr, !addTag);
  	}
Only in .: tkXText16.c
