mleisher@nmsu.edu (Mark Leisher) (11/30/90)
$@<!$,(J Jming16.bdf $@$d(J Jsong24.bdf $@$H8@$C$?(J EUC $@$G(J $@%3!<%G%$%s%0$5$l$?(J $@4A;z%[%s%H(J $@$NI=<($r(J kinput $@$G(J $@2DG=$K$9$k(J $@%Q%C%A$G$9!#(J $@(Jxlocal $@!J(Jkinput $@%=!<%9$N%5%V%@%$%l%/%H%j!<!K$K(J cd $@$7$F!"$3$N(J $@%Q%C%A$r(J $@;H$C$F2<$5$$!#(J $@$3$N(J $@%Q%C%A$O(J kinput.fix.[123] $@%Q%C%A$,(J $@4{$K(J $@;H$o$l$F$$$k;v$r(J $@A0Ds$H$7$F$$$^$9!#(J $@(J $@!JK]Lu$O(J $@<cHx!w(Jnmsu.edu $@$,(J $@9T$J$$$^$7$?!#!K(J $@(J $@(J Here is the patch to allow kinput to display EUC encoded Kanji fonts like Jming16.bdf and Jsong24.bdf. cd to the 'xlocal' subdirectory of the kinput source, and apply this patch. This patch assumes that the kinput.fix.[123] patches have already been applied. ----------------------- Cut Here ------------------------- *** XWStr.h.ORIG Thu Nov 29 18:09:58 1990 --- XWStr.h Thu Nov 29 18:10:39 1990 *************** *** 43,48 **** --- 43,49 ---- #define TWOB 1 /* 2-byte character set */ #define FONTQUERY 2 /* XQueryFont()'ed by this library */ #define GCCREAT 4 /* XtGetGC()'ed by this library */ + #define HIGHENCODING 8 /* EUC encoded font */ #define GSET(c) ((c) & 0x8000 ? ((c) & 0x80 ? 1 : 3) : ((c) & 0x80 ? 2 : 0)) *** xtwstr.c.ORIG Thu Nov 29 18:32:12 1990 --- xtwstr.c Thu Nov 29 18:33:24 1990 *************** *** 27,32 **** --- 27,33 ---- #include "XWStr.h" #define IS2B(f) (((f)->max_byte1 > 0) || ((f)->max_char_or_byte2 > 255)) + #define HighEncoding(f) ((f)->min_char_or_byte2 > 0x80) XWSGC XtWSGetGCSet(w, mask, values, fontG0, fontG1, fontG2, fontG3) *************** *** 57,62 **** --- 58,65 ---- gcset->fe[i].flag = GCCREAT; if (IS2B(gcset->fe[i].font)) gcset->fe[i].flag |= TWOB; + if (HighEncoding(gcset->fe[i].font)) + gcset->fe[i].flag |= HIGHENCODING; } else { gcset->fe[i].gc = NULL; } *** xwstr.c.ORIG Thu Nov 29 18:18:55 1990 --- xwstr.c Thu Nov 29 18:29:25 1990 *************** *** 79,84 **** --- 79,85 ---- #define G3MASK 0x8000 #define IS2B(f) (((f)->max_byte1 > 0) || ((f)->max_char_or_byte2 > 255)) + #define HighEncoding(f) ((f)->min_char_or_byte2 > 0x80) #define MIN(a, b) ((a) > (b) ? (b) : (a)) #define MAX(a, b) ((a) > (b) ? (a) : (b)) *************** *** 125,130 **** --- 126,133 ---- gcset->fe[i].flag = FONTQUERY; if (IS2B(font)) gcset->fe[i].flag = TWOB; + if (HighEncoding(font)) + gcset->fe[i].flag |= HIGHENCODING; } } *************** *** 428,433 **** --- 431,437 ---- int gmask, gset; FontEnt *fe; int is2b; + unsigned char encoding_mask; while (wstr < wstr1) { gmask = *wstr & 0x8080; *************** *** 449,454 **** --- 453,462 ---- fe = &gcset->fe[gset]; is2b = fe->flag & TWOB; + if (fe->flag & HIGHENCODING) + encoding_mask = 0xff; + else + encoding_mask = 0x7f; cp = buf; if (fe->gc == NULL) { *************** *** 463,470 **** cp = buf; } if (is2b) ! *cp++ = (c >> 8) & 0x7f; ! *cp++ = c & 0x7f; wstr++; } /* flush */ --- 471,478 ---- cp = buf; } if (is2b) ! *cp++ = (c >> 8) & encoding_mask; ! *cp++ = c & encoding_mask; wstr++; } /* flush */ ----------------------------------------------------------------------------- mleisher@nmsu.edu "I laughed. Mark Leisher I cried. Computing Research Lab I fell down. New Mexico State University It changed my life." Las Cruces, NM - Rich [Cowboy Feng's Space Bar and Grille]