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.26 by pcg, Fri Feb 27 02:52:51 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
268 275
269 bool has_codepoint (uint32_t unicode) 276 bool has_codepoint (uint32_t unicode)
270 { 277 {
271 if (unicode <= 0x001f) 278 if (unicode <= 0x001f)
272 return true; 279 return true;
280
273 if (unicode >= 0x0080 && unicode <= 0x009f) 281 if (unicode >= 0x0080 && unicode <= 0x009f)
274 return true; 282 return true;
275 283
276 if (unicode >= 0x2500 && unicode <= 0x257f 284 if (unicode >= 0x2500 && unicode <= 0x257f
277 && linedraw_cmds[unicode - 0x2500]) 285 && linedraw_cmds[unicode - 0x2500])
286 return true;
287
288 if (IS_COMPOSE (unicode))
278 return true; 289 return true;
279 290
280 switch (unicode) 291 switch (unicode)
281 { 292 {
282 case ZERO_WIDTH_CHAR: 293 case ZERO_WIDTH_CHAR:
302 313
303 while (len--) 314 while (len--)
304 { 315 {
305 text_t t = *text++; 316 text_t t = *text++;
306 317
318 // is it in our linedrawing table?
307 if (t >= 0x2500 & t <= 0x2580 && linedraw_cmds[t - 0x2500]) 319 if (t >= 0x2500 & t <= 0x2580 && linedraw_cmds[t - 0x2500])
308 { 320 {
309 const char *p = linedraw_cmds[t - 0x2500]; 321 const char *p = linedraw_cmds[t - 0x2500];
310 322
311 int x0 = x, x1 = x + r->TermWin.fwidth / 2, x2 = x + r->TermWin.fwidth - 1; 323 int x0 = x, x1 = x + (r->TermWin.fwidth - 1) / 2, x2 = x + r->TermWin.fwidth - 1;
312 int y0 = y, y1 = y + r->TermWin.fheight / 2, y2 = y + r->TermWin.fheight - 1; 324 int y0 = y, y1 = y + (r->TermWin.fheight - 1) / 2, y2 = y + r->TermWin.fheight - 1;
313 325
314 XGCValues gcv; 326 XGCValues gcv;
315 327
316 while (*p) 328 while (*p)
317 { 329 {
337 } 349 }
338 350
339 gcv.line_width = 0; 351 gcv.line_width = 0;
340 XChangeGC (d.display->display, GC, GCLineWidth, &gcv); 352 XChangeGC (d.display->display, GC, GCLineWidth, &gcv);
341 } 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 }
342 else 359 else
343 switch (*text++) 360 switch (t)
344 { 361 {
345 case NOCHAR:
346 case ZERO_WIDTH_CHAR: 362 case ZERO_WIDTH_CHAR:
347 break; 363 break;
348 default: 364 default:
349 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;
350 } 376 }
351 377
352 x += r->TermWin.fwidth; 378 x += r->TermWin.fwidth;
353 } 379 }
354} 380}
429 455
430bool 456bool
431rxvt_font_x11::set_properties (rxvt_fontprop &p, const char *name) 457rxvt_font_x11::set_properties (rxvt_fontprop &p, const char *name)
432{ 458{
433 int slashes = 0; 459 int slashes = 0;
434 const char *comp[12]; 460 const char *comp[13];
435 461
436 for (const char *c = name; *c; c++) 462 for (const char *c = name; *c; c++)
437 if (*c == '-') 463 if (*c == '-')
438 { 464 {
439 comp[slashes++] = c + 1; 465 comp[slashes++] = c + 1;

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines