… | |
… | |
72 | { CS_BIG5_EXT, "xft:AR PL Mingti2L Big5" }, |
72 | { CS_BIG5_EXT, "xft:AR PL Mingti2L Big5" }, |
73 | { CS_BIG5_EXT, "xft:AR PL KaitiM Big5" }, |
73 | { CS_BIG5_EXT, "xft:AR PL KaitiM Big5" }, |
74 | { CS_GB2312_1980_0, "xft:AR PL KaitiM GB" }, |
74 | { CS_GB2312_1980_0, "xft:AR PL KaitiM GB" }, |
75 | { CS_GB2312_1980_0, "xft:AR PL SungtiL GB" }, |
75 | { CS_GB2312_1980_0, "xft:AR PL SungtiL GB" }, |
76 | # endif |
76 | # endif |
|
|
77 | { CS_BIG5_EXT, "-*-*-*-*-*-*-*-*-*-*-c-*-big5*-0" }, |
77 | { CS_CNS11643_1992_1, "-*-*-*-*-*-*-*-*-*-*-c-*-gb2312*-0" }, |
78 | { CS_CNS11643_1992_1, "-*-*-*-*-*-*-*-*-*-*-c-*-gb2312*-0" }, |
78 | { CS_CNS11643_1992_1, "-*-*-*-*-*-*-*-*-*-*-c-*-cns11643*-1" }, |
79 | { CS_CNS11643_1992_1, "-*-*-*-*-*-*-*-*-*-*-c-*-cns11643*-1" }, |
79 | { CS_CNS11643_1992_2, "-*-*-*-*-*-*-*-*-*-*-c-*-cns11643*-2" }, |
80 | { CS_CNS11643_1992_2, "-*-*-*-*-*-*-*-*-*-*-c-*-cns11643*-2" }, |
80 | { CS_CNS11643_1992_3, "-*-*-*-*-*-*-*-*-*-*-c-*-cns11643*-3" }, |
81 | { CS_CNS11643_1992_3, "-*-*-*-*-*-*-*-*-*-*-c-*-cns11643*-3" }, |
81 | { CS_CNS11643_1992_4, "-*-*-*-*-*-*-*-*-*-*-c-*-cns11643*-4" }, |
82 | { CS_CNS11643_1992_4, "-*-*-*-*-*-*-*-*-*-*-c-*-cns11643*-4" }, |
82 | { CS_CNS11643_1992_5, "-*-*-*-*-*-*-*-*-*-*-c-*-cns11643*-5" }, |
83 | { CS_CNS11643_1992_5, "-*-*-*-*-*-*-*-*-*-*-c-*-cns11643*-5" }, |
83 | { CS_CNS11643_1992_6, "-*-*-*-*-*-*-*-*-*-*-c-*-cns11643*-6" }, |
84 | { CS_CNS11643_1992_6, "-*-*-*-*-*-*-*-*-*-*-c-*-cns11643*-6" }, |
84 | { CS_CNS11643_1992_7, "-*-*-*-*-*-*-*-*-*-*-c-*-cns11643*-7" }, |
85 | { CS_CNS11643_1992_7, "-*-*-*-*-*-*-*-*-*-*-c-*-cns11643*-7" }, |
85 | { CS_CNS11643_1992_F, "-*-*-*-*-*-*-*-*-*-*-c-*-cns11643*-f" }, |
86 | { CS_CNS11643_1992_F, "-*-*-*-*-*-*-*-*-*-*-c-*-cns11643*-f" }, |
86 | #endif |
87 | #endif |
87 | |
88 | |
88 | #if XFT |
89 | #if XFT |
89 | { CS_UNICODE, "xft:Andale Mono" }, |
90 | { CS_UNICODE, "xft:Andale Mono" }, |
90 | { CS_UNICODE, "xft:Arial Unicode MS" }, |
91 | { CS_UNICODE, "xft:Arial Unicode MS" }, |
… | |
… | |
98 | { CS_UNKNOWN, 0 } |
99 | { CS_UNKNOWN, 0 } |
99 | }; |
100 | }; |
100 | |
101 | |
101 | ///////////////////////////////////////////////////////////////////////////// |
102 | ///////////////////////////////////////////////////////////////////////////// |
102 | |
103 | |
|
|
104 | #if XFT |
103 | rxvt_drawable::~rxvt_drawable () |
105 | rxvt_drawable::~rxvt_drawable () |
104 | { |
106 | { |
105 | if (xftdrawable) |
107 | if (xftdrawable) |
106 | XftDrawDestroy (xftdrawable); |
108 | XftDrawDestroy (xftdrawable); |
107 | } |
109 | } |
… | |
… | |
111 | if (!xftdrawable) |
113 | if (!xftdrawable) |
112 | xftdrawable = XftDrawCreate (display->display, drawable, display->visual, display->cmap); |
114 | xftdrawable = XftDrawCreate (display->display, drawable, display->visual, display->cmap); |
113 | |
115 | |
114 | return xftdrawable; |
116 | return xftdrawable; |
115 | } |
117 | } |
|
|
118 | #endif |
116 | |
119 | |
117 | ///////////////////////////////////////////////////////////////////////////// |
120 | ///////////////////////////////////////////////////////////////////////////// |
118 | |
121 | |
119 | static void *enc_buf; |
122 | static void *enc_buf; |
120 | static uint32_t enc_len; |
123 | static uint32_t enc_len; |
… | |
… | |
300 | |
303 | |
301 | while (len--) |
304 | while (len--) |
302 | { |
305 | { |
303 | text_t t = *text++; |
306 | text_t t = *text++; |
304 | |
307 | |
|
|
308 | // is it in our linedrawing table? |
305 | if (t >= 0x2500 & t <= 0x2580 && linedraw_cmds[t - 0x2500]) |
309 | if (t >= 0x2500 & t <= 0x2580 && linedraw_cmds[t - 0x2500]) |
306 | { |
310 | { |
307 | const char *p = linedraw_cmds[t - 0x2500]; |
311 | const char *p = linedraw_cmds[t - 0x2500]; |
308 | |
312 | |
309 | int x0 = x, x1 = x + r->TermWin.fwidth / 2, x2 = x + r->TermWin.fwidth ; |
313 | int x0 = x, x1 = x + r->TermWin.fwidth / 2, x2 = x + r->TermWin.fwidth - 1; |
310 | int y0 = y, y1 = y + r->TermWin.fheight / 2, y2 = y + r->TermWin.fheight; |
314 | int y0 = y, y1 = y + r->TermWin.fheight / 2, y2 = y + r->TermWin.fheight - 1; |
311 | |
315 | |
312 | XGCValues gcv; |
316 | XGCValues gcv; |
313 | |
317 | |
314 | while (*p) |
318 | while (*p) |
315 | { |
319 | { |
… | |
… | |
336 | |
340 | |
337 | gcv.line_width = 0; |
341 | gcv.line_width = 0; |
338 | XChangeGC (d.display->display, GC, GCLineWidth, &gcv); |
342 | XChangeGC (d.display->display, GC, GCLineWidth, &gcv); |
339 | } |
343 | } |
340 | else |
344 | else |
341 | switch (*text++) |
345 | switch (t) |
342 | { |
346 | { |
343 | case NOCHAR: |
|
|
344 | case ZERO_WIDTH_CHAR: |
347 | case ZERO_WIDTH_CHAR: |
345 | break; |
348 | break; |
346 | default: |
349 | default: |
347 | XDrawRectangle (d.display->display, d, GC, x + 2, y + 2, r->TermWin.fwidth - 5, r->TermWin.fheight - 5); |
350 | int w = 0; |
|
|
351 | while (len > 0 && *text == NOCHAR) |
|
|
352 | { |
|
|
353 | ++text; |
|
|
354 | --len; |
|
|
355 | w += r->TermWin.fwidth; |
|
|
356 | } |
|
|
357 | |
|
|
358 | XDrawRectangle (d.display->display, d, GC, x + 2, y + 2, |
|
|
359 | w + r->TermWin.fwidth - 5, r->TermWin.fheight - 5); |
|
|
360 | x += w; |
348 | } |
361 | } |
349 | |
362 | |
350 | x += r->TermWin.fwidth; |
363 | x += r->TermWin.fwidth; |
351 | } |
364 | } |
352 | } |
365 | } |