diff -c -r hanterm304beta4/Imakefile hanterm/Imakefile *** hanterm304beta4/Imakefile Wed Jan 7 20:24:35 1998 --- hanterm/Imakefile Mon Feb 2 06:41:21 1998 *************** *** 75,81 **** # CDEBUGFLAGS = +O4 EXTRA_INCLUDES = -I. -I/usr/contrib/X11R6/include LDOPTIONS = -L/usr/contrib/X11R6/lib ! #else /* for R4 */ #ifndef XCOMM EXTRA_INCLUDES = -I. --- 75,81 ---- # CDEBUGFLAGS = +O4 EXTRA_INCLUDES = -I. -I/usr/contrib/X11R6/include LDOPTIONS = -L/usr/contrib/X11R6/lib ! ##else /* for R4 */ #ifndef XCOMM EXTRA_INCLUDES = -I. diff -c -r hanterm304beta4/charproc.c hanterm/charproc.c *** hanterm304beta4/charproc.c Fri Nov 21 17:07:46 1997 --- hanterm/charproc.c Mon Feb 2 07:42:30 1998 *************** *** 67,72 **** --- 67,78 ---- #endif #endif + #if !defined(NO_PATCH_FONT_JOHABNZ) /* by hanmaum 1998.2.2 */ + extern int font_no_zero_width_char; + extern int font_minus_width_char_byte1; + extern int font_minus_width_char_byte2; + #endif + extern jmp_buf VTend; extern Widget toplevel; *************** *** 3441,3447 **** --- 3447,3478 ---- if (hfs->ascent + hfs->descent == 0 || hfs->max_bounds.width == 0) goto bad; /* can't use a 0-sized font */ + #if !defined(NO_PATCH_FONT_JOHABNZ) /* by hanmaum 1998.2.2 */ + if (font_ks_mode == -1 && font_jo_mode != True + && hfs != NULL && hfs->per_char != NULL + && hfs->per_char[1].width != 0) { + register int i; + int char_num; + int minus_width = - hfs->per_char[1].width; + char_num = (hfs->max_byte1 - hfs->min_byte1 + 1) + * (hfs->max_char_or_byte2 - hfs->min_char_or_byte2 + 1); + + for (i = char_num-1; i >= 0; i--) { + if (hfs->per_char[i].width == minus_width) { + font_no_zero_width_char = 1; + font_minus_width_char_byte1 = i + / (hfs->max_char_or_byte2 - hfs->min_char_or_byte2 + 1) + + hfs->min_byte1; + font_minus_width_char_byte2 = i + % (hfs->max_char_or_byte2 - hfs->min_char_or_byte2 + 1) + + hfs->min_char_or_byte2; + break; + } + } + } + #endif + if (!(bfontname && (bfs = XLoadQueryFont (screen->display, bfontname)))) bfs = nfs; diff -c -r hanterm304beta4/hangul.c hanterm/hangul.c *** hanterm304beta4/hangul.c Fri Nov 21 11:26:46 1997 --- hanterm/hangul.c Mon Feb 2 07:41:44 1998 *************** *** 9,14 **** --- 9,20 ---- #include "hangul.h" #include + #if !defined(NO_PATCH_FONT_JOHABNZ) /* by hanmaum 1998.2.2 */ + extern int font_no_zero_width_char; + extern int font_minus_width_char_byte1; + extern int font_minus_width_char_byte2; + #endif + extern int convert_3_to_ks(); extern int convert_3_to_johab(); extern int convert_3_to_jo844(); *************** *** 212,223 **** if( gc == hgc ) XDrawImageString(d, w, gc, x, y, (char*)buf, 2*n); else if( font_ks_mode == -1 ) XDrawString16(d, w, hgc, x, y, buf, n); else XDrawImageString16(d, w, hgc, x, y, buf, n); /* end of modification */ ! ! #if defined(DGUX_XSERVER) || defined(DGUX) /* * In DGUX XServer, XDrawImageString16() with hangul johab fonts which * uses ASCENT area does not work. --- 218,244 ---- if( gc == hgc ) XDrawImageString(d, w, gc, x, y, (char*)buf, 2*n); else if( font_ks_mode == -1 ) + #if !defined(NO_PATCH_HDRAWIMAGESTRING_BUG) /* by hanmaum 1998.2.2 */ + { + static XChar2b buf2[TEXT_BUF_SIZE]; + register int i; + int hlen = (p-str)/2; + for (i = 0; i < hlen; i++) buf2[i].byte1 = buf2[i].byte2 = 0; + XDrawImageString16(d, w, hgc, x, y, buf2, hlen); + XDrawString16(d, w, hgc, x, y, buf, n); + } + #else XDrawString16(d, w, hgc, x, y, buf, n); + #endif else XDrawImageString16(d, w, hgc, x, y, buf, n); + /* end of modification */ ! /***** by hanmaum 1998.2.2 ! The below workaround is not needed if you apply the above buf2 patch by me ! #if defined(DGUX_XSERVER) || defined(DGUX) ! *****/ ! #if defined(NO_PATCH_HDRAWIMAGESTRING_BUG) /* by hanmaum 1998.2.2 */ /* * In DGUX XServer, XDrawImageString16() with hangul johab fonts which * uses ASCENT area does not work. *************** *** 1184,1189 **** --- 1205,1217 ---- /* ¤¡,¤» À϶§ Ưº°Ã³¸® */ break; } + #if !defined(NO_PATCH_FONT_JOHABNZ) /* by hanmaum 1998.2.2 */ + if (i > 0 && font_no_zero_width_char != 0) { + des[i].byte1 = font_minus_width_char_byte1; + des[i].byte2 = font_minus_width_char_byte2; + i++; + } + #endif des[i].byte1 = ind >> 8; des[i].byte2 = ind; i++; *************** *** 1192,1205 **** --- 1220,1246 ---- ind = l * 4 + lcon_map[m] + (l < 18 ? 397 : 393); /* l == 18 À϶§ ¾Æ¹«¹Þħµµ ¾Æ´Ï±â¶§¹®¿¡ Ưº° ó¸® */ + #if !defined(NO_PATCH_FONT_JOHABNZ) /* by hanmaum 1998.2.2 */ + if (i > 0 && font_no_zero_width_char != 0) { + des[i].byte1 = font_minus_width_char_byte1; + des[i].byte2 = font_minus_width_char_byte2; + i++; + } + #endif des[i].byte1 = ind >> 8; des[i].byte2 = ind; i++; } if (f != 1 && m == 2 && l == 1) { /* initial sound only? */ + #if !defined(NO_PATCH_FONT_JOHABNZ) /* by hanmaum 1998.2.2 */ + if (font_no_zero_width_char == 0) { + #endif des[i].byte1 = 0; /* dummy for no zero width */ des[i].byte2 = 0; i++; + #if !defined(NO_PATCH_FONT_JOHABNZ) /* by hanmaum 1998.2.2 */ + } + #endif } return i; } diff -c -r hanterm304beta4/main.c hanterm/main.c *** hanterm304beta4/main.c Tue Dec 9 13:12:50 1997 --- hanterm/main.c Mon Feb 2 07:42:46 1998 *************** *** 829,835 **** --- 829,843 ---- Bool can_use_hanja = False; /**/ + /* addition by hanmaum for X Server that doesn't allow zero width char font */ + /* : 1998.2.2 */ + #if !defined(NO_PATCH_FONT_JOHABNZ) + int font_no_zero_width_char = 0; + int font_minus_width_char_byte1 = 0; + int font_minus_width_char_byte2 = 0; + #endif + #ifdef ALLOWLOGFILEONOFF extern void StartLog(); extern void CloseLog();