diff -u -r hanterm304beta3/charproc.c hanterm/charproc.c --- hanterm304beta3/charproc.c Mon Jun 3 08:39:09 1996 +++ hanterm/charproc.c Sun Feb 1 03:25:29 1998 @@ -67,6 +67,13 @@ #endif #endif +#if 1 /* by hanmaum 1998.2.1 */ +extern int font_no_zero_width_char; +extern int font_minus_width_char_byte1; +extern int font_minus_width_char_byte2; +extern int font_ks_mode; +#endif + extern jmp_buf VTend; extern Widget toplevel; @@ -3383,6 +3390,30 @@ if (!(hfs = XLoadQueryFont (screen->display, hfontname))) goto bad; if (hfs->ascent + hfs->descent == 0 || hfs->max_bounds.width == 0) goto bad; /* can't use a 0-sized font */ +#if 1 /* by hanmaum 1998.2.1 */ + if (font_ks_mode == -1 && 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)))) diff -u -r hanterm304beta3/hangul.c hanterm/hangul.c --- hanterm304beta3/hangul.c Mon Jun 3 09:29:02 1996 +++ hanterm/hangul.c Sun Feb 1 03:34:33 1998 @@ -9,6 +9,12 @@ #include "hangul.h" #include +#if 1 /* by hanmaum 1998.2.1 */ +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 (*converter)(); @@ -205,10 +211,25 @@ if( gc == hgc ) XDrawImageString(d, w, gc, x, y, (char*)buf, 2*n); else +#if 1 /* by hanmaum 1998.2.1 */ +{ + 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 XDrawImageString16(d, w, hgc, x, y, buf, n); -/* end of modification */ +#endif +/* end of modification */ +/***** by hanmaum 1998.2.1 + The below workaround is not needed if you apply the above buf2 patch by me #if defined(DGUX_XSERVER) || defined(DGUX) +*****/ +#if 0 /* * In DGUX XServer, XDrawImageString16() with hangul johab fonts which * uses ASCENT area does not work. @@ -1175,6 +1196,13 @@ /* ¤¡,¤» À϶§ Ưº°Ã³¸® */ break; } +#if 1 /* by hanmaum 1998.2.1 */ + 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++; @@ -1183,14 +1211,27 @@ ind = l * 4 + lcon_map[m] + (l < 18 ? 397 : 393); /* l == 18 À϶§ ¾Æ¹«¹Þħµµ ¾Æ´Ï±â¶§¹®¿¡ Ưº° ó¸® */ +#if 1 /* by hanmaum 1998.2.1 */ + 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 1 /* by hanmaum 1998.2.1 */ + if (font_no_zero_width_char == 0) { +#endif des[i].byte1 = 0; /* dummy for no zero width */ des[i].byte2 = 0; i++; +#if 1 /* by hanmaum 1998.2.1 */ + } +#endif } return i; } diff -u -r hanterm304beta3/main.c hanterm/main.c --- hanterm304beta3/main.c Wed Apr 17 09:46:53 1996 +++ hanterm/main.c Sun Feb 1 03:25:30 1998 @@ -822,6 +822,14 @@ Bool can_use_hanja = False; /**/ +/* addition by hanmaum for X Server that doesn't allow zero width char font */ +/* : 1998.2.1 */ +#if 1 +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();