ViewVC Help
View File | Revision Log | Show Annotations | Download File
/cvs/rxvt-unicode/src/defaultfont.C
(Generate patch)

Comparing rxvt-unicode/src/defaultfont.C (file contents):
Revision 1.24 by pcg, Tue Feb 24 00:44:23 2004 UTC vs.
Revision 1.35 by pcg, Thu Mar 4 20:09:01 2004 UTC

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, "-*-*-*-*-*-*-*-*-*-*-c-*-big5-0" },
78 { CS_BIG5_PLUS, "-*-*-*-*-*-*-*-*-*-*-c-*-big5p-0" },
79 { CS_BIG5_EXT, "-*-*-*-*-*-*-*-*-*-*-c-*-big5.eten-0" },
77 { CS_CNS11643_1992_1, "-*-*-*-*-*-*-*-*-*-*-c-*-gb2312*-0" }, 80 { CS_CNS11643_1992_1, "-*-*-*-*-*-*-*-*-*-*-c-*-gb2312*-0" },
78 { CS_CNS11643_1992_1, "-*-*-*-*-*-*-*-*-*-*-c-*-cns11643*-1" }, 81 { CS_CNS11643_1992_1, "-*-*-*-*-*-*-*-*-*-*-c-*-cns11643*-1" },
79 { CS_CNS11643_1992_2, "-*-*-*-*-*-*-*-*-*-*-c-*-cns11643*-2" }, 82 { CS_CNS11643_1992_2, "-*-*-*-*-*-*-*-*-*-*-c-*-cns11643*-2" },
80 { CS_CNS11643_1992_3, "-*-*-*-*-*-*-*-*-*-*-c-*-cns11643*-3" }, 83 { CS_CNS11643_1992_3, "-*-*-*-*-*-*-*-*-*-*-c-*-cns11643*-3" },
81 { CS_CNS11643_1992_4, "-*-*-*-*-*-*-*-*-*-*-c-*-cns11643*-4" }, 84 { CS_CNS11643_1992_4, "-*-*-*-*-*-*-*-*-*-*-c-*-cns11643*-4" },
82 { CS_CNS11643_1992_5, "-*-*-*-*-*-*-*-*-*-*-c-*-cns11643*-5" }, 85 { CS_CNS11643_1992_5, "-*-*-*-*-*-*-*-*-*-*-c-*-cns11643*-5" },
83 { CS_CNS11643_1992_6, "-*-*-*-*-*-*-*-*-*-*-c-*-cns11643*-6" }, 86 { CS_CNS11643_1992_6, "-*-*-*-*-*-*-*-*-*-*-c-*-cns11643*-6" },
84 { CS_CNS11643_1992_7, "-*-*-*-*-*-*-*-*-*-*-c-*-cns11643*-7" }, 87 { CS_CNS11643_1992_7, "-*-*-*-*-*-*-*-*-*-*-c-*-cns11643*-7" },
85 { CS_CNS11643_1992_F, "-*-*-*-*-*-*-*-*-*-*-c-*-cns11643*-f" }, 88 { CS_CNS11643_1992_F, "-*-*-*-*-*-*-*-*-*-*-c-*-cns11643*-f" },
86#endif 89#endif
87 90
88#if XFT 91#if XFT
89 { CS_UNICODE, "xft:Andale Mono" }, 92 { CS_UNICODE, "xft:Andale Mono" },
90 { CS_UNICODE, "xft:Arial Unicode MS" }, 93 { CS_UNICODE, "xft:Arial Unicode MS" },
93 { CS_UNICODE, "xft:FreeMono" }, 96 { CS_UNICODE, "xft:FreeMono" },
94 { CS_UNICODE, "-*-unifont-*-*-*-*-*-*-*-*-c-*-iso10646-1" }, 97 { CS_UNICODE, "-*-unifont-*-*-*-*-*-*-*-*-c-*-iso10646-1" },
95 { CS_UNICODE, "-*-*-*-r-*-*-*-*-*-*-c-*-iso10646-1" }, 98 { CS_UNICODE, "-*-*-*-r-*-*-*-*-*-*-c-*-iso10646-1" },
96 { CS_UNICODE, "-*-*-*-r-*-*-*-*-*-*-m-*-iso10646-1" }, 99 { CS_UNICODE, "-*-*-*-r-*-*-*-*-*-*-m-*-iso10646-1" },
97 100
101#if UNICODE_3 && XFT
102 { CS_UNICODE, "xft:Code2001" }, // contains many plane-1 characters
103#endif
104
98 { CS_UNKNOWN, 0 } 105 { CS_UNKNOWN, 0 }
99}; 106};
100 107
101///////////////////////////////////////////////////////////////////////////// 108/////////////////////////////////////////////////////////////////////////////
102 109
110#if XFT
103rxvt_drawable::~rxvt_drawable () 111rxvt_drawable::~rxvt_drawable ()
104{ 112{
105 if (xftdrawable) 113 if (xftdrawable)
106 XftDrawDestroy (xftdrawable); 114 XftDrawDestroy (xftdrawable);
107} 115}
111 if (!xftdrawable) 119 if (!xftdrawable)
112 xftdrawable = XftDrawCreate (display->display, drawable, display->visual, display->cmap); 120 xftdrawable = XftDrawCreate (display->display, drawable, display->visual, display->cmap);
113 121
114 return xftdrawable; 122 return xftdrawable;
115} 123}
124#endif
116 125
117///////////////////////////////////////////////////////////////////////////// 126/////////////////////////////////////////////////////////////////////////////
118 127
119static void *enc_buf; 128static void *enc_buf;
120static uint32_t enc_len; 129static uint32_t enc_len;
266 275
267 bool has_codepoint (uint32_t unicode) 276 bool has_codepoint (uint32_t unicode)
268 { 277 {
269 if (unicode <= 0x001f) 278 if (unicode <= 0x001f)
270 return true; 279 return true;
280
271 if (unicode >= 0x0080 && unicode <= 0x009f) 281 if (unicode >= 0x0080 && unicode <= 0x009f)
272 return true; 282 return true;
273 283
274 if (unicode >= 0x2500 && unicode <= 0x257f 284 if (unicode >= 0x2500 && unicode <= 0x257f
275 && linedraw_cmds[unicode - 0x2500]) 285 && linedraw_cmds[unicode - 0x2500])
286 return true;
287
288 if (IS_COMPOSE (unicode))
276 return true; 289 return true;
277 290
278 switch (unicode) 291 switch (unicode)
279 { 292 {
280 case ZERO_WIDTH_CHAR: 293 case ZERO_WIDTH_CHAR:
300 313
301 while (len--) 314 while (len--)
302 { 315 {
303 text_t t = *text++; 316 text_t t = *text++;
304 317
318 // is it in our linedrawing table?
305 if (t >= 0x2500 & t <= 0x2580 && linedraw_cmds[t - 0x2500]) 319 if (t >= 0x2500 & t <= 0x2580 && linedraw_cmds[t - 0x2500])
306 { 320 {
307 const char *p = linedraw_cmds[t - 0x2500]; 321 const char *p = linedraw_cmds[t - 0x2500];
308 322
309 int x0 = x, x1 = x + r->TermWin.fwidth / 2, x2 = x + r->TermWin.fwidth ; 323 int x0 = x, x1 = x + (r->TermWin.fwidth - 1) / 2, x2 = x + r->TermWin.fwidth - 1;
310 int y0 = y, y1 = y + r->TermWin.fheight / 2, y2 = y + r->TermWin.fheight; 324 int y0 = y, y1 = y + (r->TermWin.fheight - 1) / 2, y2 = y + r->TermWin.fheight - 1;
311 325
312 XGCValues gcv; 326 XGCValues gcv;
313 327
314 while (*p) 328 while (*p)
315 { 329 {
335 } 349 }
336 350
337 gcv.line_width = 0; 351 gcv.line_width = 0;
338 XChangeGC (d.display->display, GC, GCLineWidth, &gcv); 352 XChangeGC (d.display->display, GC, GCLineWidth, &gcv);
339 } 353 }
354 else if (IS_COMPOSE (t))
355 {
356 const compose_char &cc = rxvt_composite[t];
357 (void)0; //D ADD pseudo handling here
358 }
340 else 359 else
341 switch (*text++) 360 switch (t)
342 { 361 {
343 case NOCHAR:
344 case ZERO_WIDTH_CHAR: 362 case ZERO_WIDTH_CHAR:
345 break; 363 break;
346 default: 364 default:
347 XDrawRectangle (d.display->display, d, GC, x + 2, y + 2, r->TermWin.fwidth - 5, r->TermWin.fheight - 5); 365 int w = 0;
366 while (len > 0 && *text == NOCHAR)
367 {
368 ++text;
369 --len;
370 w += r->TermWin.fwidth;
371 }
372
373 XDrawRectangle (d.display->display, d, GC, x + 2, y + 2,
374 w + r->TermWin.fwidth - 5, r->TermWin.fheight - 5);
375 x += w;
348 } 376 }
349 377
350 x += r->TermWin.fwidth; 378 x += r->TermWin.fwidth;
351 } 379 }
352} 380}
427 455
428bool 456bool
429rxvt_font_x11::set_properties (rxvt_fontprop &p, const char *name) 457rxvt_font_x11::set_properties (rxvt_fontprop &p, const char *name)
430{ 458{
431 int slashes = 0; 459 int slashes = 0;
432 const char *comp[12]; 460 const char *comp[13];
433 461
434 for (const char *c = name; *c; c++) 462 for (const char *c = name; *c; c++)
435 if (*c == '-') 463 if (*c == '-')
436 { 464 {
437 comp[slashes++] = c + 1; 465 comp[slashes++] = c + 1;

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines