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.3 by pcg, Thu Nov 27 20:09:00 2003 UTC vs.
Revision 1.5 by pcg, Thu Dec 4 00:43:26 2003 UTC

270 270
271 if (t >= 0x2500 & t <= 0x2580 && linedraw_cmds[t - 0x2500]) 271 if (t >= 0x2500 & t <= 0x2580 && linedraw_cmds[t - 0x2500])
272 { 272 {
273 const char *p = linedraw_cmds[t - 0x2500]; 273 const char *p = linedraw_cmds[t - 0x2500];
274 274
275 int x0 = x, x1 = x + (r->TermWin.fwidth - 1) / 2, x2 = x + r->TermWin.fwidth - 1; 275 int x0 = x, x1 = x + r->TermWin.fwidth / 2, x2 = x + r->TermWin.fwidth ;
276 int y0 = y, y1 = y + (r->TermWin.fheight - 1) / 2, y2 = y + r->TermWin.fheight - 1; 276 int y0 = y, y1 = y + r->TermWin.fheight / 2, y2 = y + r->TermWin.fheight;
277 277
278 XGCValues gcv; 278 XGCValues gcv;
279
280 gcv.cap_style = CapButt;
281 XChangeGC (DISPLAY, GC, GCCapStyle, &gcv);
282 279
283 while (*p) 280 while (*p)
284 { 281 {
285 switch (*p++) 282 switch (*p++)
286 { 283 {
894rxvt_fontset::realize_font (int i) 891rxvt_fontset::realize_font (int i)
895{ 892{
896 if (fonts[i]->loaded) 893 if (fonts[i]->loaded)
897 return true; 894 return true;
898 895
896 fonts[i]->loaded = true;
897
899 if (fonts[i]->load (height)) 898 if (!fonts[i]->load (height))
900 return fonts[i]->loaded = true; 899 {
901 900 fonts[i]->cs = CS_UNKNOWN;
902 delete fonts[i];
903 fonts.erase (fonts.begin () + i);
904
905 return false; 901 return false;
902 }
903
904 return true;
906} 905}
907 906
908void 907void
909rxvt_fontset::populate (const char *desc) 908rxvt_fontset::populate (const char *desc)
910{ 909{
947 { 946 {
948 if (FROM_UNICODE (f->cs, unicode) == NOCHAR) 947 if (FROM_UNICODE (f->cs, unicode) == NOCHAR)
949 goto next_font; 948 goto next_font;
950 949
951 if (!realize_font (i)) 950 if (!realize_font (i))
952 {
953 --i;
954 goto next_font; 951 goto next_font;
955 } 952 }
956 953
957 //printf ("added font %s for %04lx\n", f->name, unicode);
958 }
959
960 if (f->has_codepoint (unicode)) 954 if (f->cs != CS_UNKNOWN && f->has_codepoint (unicode))
961 return i; 955 return i;
962 956
963 next_font: 957 next_font:
964 if (i == fonts.size () - 1 && fallback->name) 958 if (i == fonts.size () - 1 && fallback->name)
965 { 959 {
966 fonts.push_back (new_font (fallback->name, fallback->cs)); 960 fonts.push_back (new_font (fallback->name, fallback->cs));
967 fallback++; 961 fallback++;
962 i = 0;
968 } 963 }
969 } 964 }
970 965
971 return 0; /* we must return SOME font */ 966 return 0; /* we must return SOME font */
972} 967}

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines