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.38 by pcg, Fri Mar 5 21:26:01 2004 UTC vs.
Revision 1.41 by pcg, Mon Mar 15 01:27:46 2004 UTC

61# if XFT 61# if XFT
62 // prefer xft for complex scripts 62 // prefer xft for complex scripts
63 { CS_UNICODE, "xft:Kochi Gothic:antialias=false" }, 63 { CS_UNICODE, "xft:Kochi Gothic:antialias=false" },
64# endif 64# endif
65 { CS_JIS0201_1976_0, "-*-mincho-*-r-*--*-*-*-*-c-*-jisx0201*-0" }, 65 { CS_JIS0201_1976_0, "-*-mincho-*-r-*--*-*-*-*-c-*-jisx0201*-0" },
66 { CS_JIS0208_1983_0, "-*-mincho-*-r-*--*-*-*-*-c-*-jisx0208*-0" }, 66 { CS_JIS0208_1990_0, "-*-mincho-*-r-*--*-*-*-*-c-*-jisx0208*-0" },
67 { CS_JIS0212_1990_0, "-*-mincho-*-r-*--*-*-*-*-c-*-jisx0212*-0" }, 67 { CS_JIS0212_1990_0, "-*-mincho-*-r-*--*-*-*-*-c-*-jisx0212*-0" },
68#endif 68#endif
69 69
70#if ENCODING_CN || ENCODING_CN_EXT 70#if ENCODING_CN || ENCODING_CN_EXT
71# if XFT 71# if XFT
273 set_name ("built-in pseudofont"); 273 set_name ("built-in pseudofont");
274 274
275 return true; 275 return true;
276 } 276 }
277 277
278 bool has_codepoint (uint32_t unicode) 278 bool has_codepoint (unicode_t unicode)
279 { 279 {
280 if (unicode <= 0x001f) 280 if (unicode <= 0x001f)
281 return true; 281 return true;
282 282
283 if (unicode >= 0x0080 && unicode <= 0x009f) 283 if (unicode >= 0x0080 && unicode <= 0x009f)
313 313
314 XSetForeground (d.display->display, GC, r->PixColors[fg]); 314 XSetForeground (d.display->display, GC, r->PixColors[fg]);
315 315
316 while (len--) 316 while (len--)
317 { 317 {
318#if ENABLE_COMBINING
318 compose_char *cc; 319 compose_char *cc;
320#endif
319 text_t t = *text++; 321 text_t t = *text++;
320 322
321 // is it in our linedrawing table? 323 // is it in our linedrawing table?
322 if (t >= 0x2500 & t <= 0x2580 && linedraw_cmds[t - 0x2500]) 324 if (t >= 0x2500 & t <= 0x2580 && linedraw_cmds[t - 0x2500])
323 { 325 {
352 } 354 }
353 355
354 gcv.line_width = 0; 356 gcv.line_width = 0;
355 XChangeGC (d.display->display, GC, GCLineWidth, &gcv); 357 XChangeGC (d.display->display, GC, GCLineWidth, &gcv);
356 } 358 }
359#if ENABLE_COMBINING
357 else if (IS_COMPOSE (t) && (cc = rxvt_composite[t])) 360 else if (IS_COMPOSE (t) && (cc = rxvt_composite[t]))
358 { 361 {
359 rxvt_font *f1 = (*fs)[fs->find_font (cc->c1)]; 362 rxvt_font *f1 = (*fs)[fs->find_font (cc->c1)];
360 f1->draw (d, x, y, &(t = cc->c1), 1, fg, bg); 363 f1->draw (d, x, y, &(t = cc->c1), 1, fg, bg);
361 if (cc->c2 != NOCHAR) 364 if (cc->c2 != NOCHAR)
366 : (*fs)[fs->find_font (cc->c2)]; 369 : (*fs)[fs->find_font (cc->c2)];
367 370
368 f2->draw (d, x, y, &(t = cc->c2), 1, fg, -1); 371 f2->draw (d, x, y, &(t = cc->c2), 1, fg, -1);
369 } 372 }
370 } 373 }
374#endif
371 else 375 else
372 switch (t) 376 switch (t)
373 { 377 {
374 case ZERO_WIDTH_CHAR: 378 case ZERO_WIDTH_CHAR:
375 break; 379 break;
400 404
401 rxvt_fontprop properties (); 405 rxvt_fontprop properties ();
402 406
403 bool load (const rxvt_fontprop &prop); 407 bool load (const rxvt_fontprop &prop);
404 408
405 bool has_codepoint (uint32_t unicode); 409 bool has_codepoint (unicode_t unicode);
406 410
407 void draw (rxvt_drawable &d, int x, int y, 411 void draw (rxvt_drawable &d, int x, int y,
408 const text_t *text, int len, 412 const text_t *text, int len,
409 int fg, int bg); 413 int fg, int bg);
410 414
657 f = 0; 661 f = 0;
658 } 662 }
659} 663}
660 664
661bool 665bool
662rxvt_font_x11::has_codepoint (uint32_t unicode) 666rxvt_font_x11::has_codepoint (unicode_t unicode)
663{ 667{
664 uint32_t ch = FROM_UNICODE (cs, unicode); 668 uint32_t ch = FROM_UNICODE (cs, unicode);
665 669
666 if (ch == NOCHAR) 670 if (ch == NOCHAR)
667 return false; 671 return false;
809 813
810 void draw (rxvt_drawable &d, int x, int y, 814 void draw (rxvt_drawable &d, int x, int y,
811 const text_t *text, int len, 815 const text_t *text, int len,
812 int fg, int bg); 816 int fg, int bg);
813 817
814 bool has_codepoint (uint32_t unicode); 818 bool has_codepoint (unicode_t unicode);
815 819
816protected: 820protected:
817 XftFont *f; 821 XftFont *f;
818}; 822};
819 823
932 936
933 return true; 937 return true;
934} 938}
935 939
936bool 940bool
937rxvt_font_xft::has_codepoint (uint32_t unicode) 941rxvt_font_xft::has_codepoint (unicode_t unicode)
938{ 942{
939 return XftCharExists (DISPLAY, f, unicode); 943 return XftCharExists (DISPLAY, f, unicode);
940} 944}
941 945
942void 946void
1145 1149
1146 return true; 1150 return true;
1147} 1151}
1148 1152
1149int 1153int
1150rxvt_fontset::find_font (uint32_t unicode) 1154rxvt_fontset::find_font (unicode_t unicode)
1151{ 1155{
1152 for (unsigned int i = 0; i < fonts.size (); i++) 1156 for (unsigned int i = 0; i < fonts.size (); i++)
1153 { 1157 {
1154 rxvt_font *f = fonts[i]; 1158 rxvt_font *f = fonts[i];
1155 1159

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines