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.34 by pcg, Thu Mar 4 04:28:50 2004 UTC vs.
Revision 1.38 by pcg, Fri Mar 5 21:26:01 2004 UTC

268 bool load (const rxvt_fontprop &prop) 268 bool load (const rxvt_fontprop &prop)
269 { 269 {
270 width = 1; height = 1; 270 width = 1; height = 1;
271 ascent = 1; descent = 0; 271 ascent = 1; descent = 0;
272 272
273 set_name ("built-in pseudofont");
274
273 return true; 275 return true;
274 } 276 }
275 277
276 bool has_codepoint (uint32_t unicode) 278 bool has_codepoint (uint32_t unicode)
277 { 279 {
283 285
284 if (unicode >= 0x2500 && unicode <= 0x257f 286 if (unicode >= 0x2500 && unicode <= 0x257f
285 && linedraw_cmds[unicode - 0x2500]) 287 && linedraw_cmds[unicode - 0x2500])
286 return true; 288 return true;
287 289
288 if (IS_PSEUDO (unicode)) 290 if (IS_COMPOSE (unicode))
289 return true; 291 return true;
290 292
291 switch (unicode) 293 switch (unicode)
292 { 294 {
293 case ZERO_WIDTH_CHAR: 295 case ZERO_WIDTH_CHAR:
311 313
312 XSetForeground (d.display->display, GC, r->PixColors[fg]); 314 XSetForeground (d.display->display, GC, r->PixColors[fg]);
313 315
314 while (len--) 316 while (len--)
315 { 317 {
318 compose_char *cc;
316 text_t t = *text++; 319 text_t t = *text++;
317 320
318 // is it in our linedrawing table? 321 // is it in our linedrawing table?
319 if (t >= 0x2500 & t <= 0x2580 && linedraw_cmds[t - 0x2500]) 322 if (t >= 0x2500 & t <= 0x2580 && linedraw_cmds[t - 0x2500])
320 { 323 {
349 } 352 }
350 353
351 gcv.line_width = 0; 354 gcv.line_width = 0;
352 XChangeGC (d.display->display, GC, GCLineWidth, &gcv); 355 XChangeGC (d.display->display, GC, GCLineWidth, &gcv);
353 } 356 }
354 else if (IS_PSEUDO (t)) 357 else if (IS_COMPOSE (t) && (cc = rxvt_composite[t]))
358 {
359 rxvt_font *f1 = (*fs)[fs->find_font (cc->c1)];
360 f1->draw (d, x, y, &(t = cc->c1), 1, fg, bg);
361 if (cc->c2 != NOCHAR)
355 { 362 {
356 const compose_char &cc = r->composite (t); 363 // prefer font of first character, for no good reasons
357 (void)0; //D ADD pseudo handling here 364 rxvt_font *f2 = f1->has_codepoint (cc->c2)
365 ? f1
366 : (*fs)[fs->find_font (cc->c2)];
367
368 f2->draw (d, x, y, &(t = cc->c2), 1, fg, -1);
369 }
358 } 370 }
359 else 371 else
360 switch (t) 372 switch (t)
361 { 373 {
362 case ZERO_WIDTH_CHAR: 374 case ZERO_WIDTH_CHAR:
1026 f = new rxvt_font_x11; 1038 f = new rxvt_font_x11;
1027 } 1039 }
1028 else 1040 else
1029 f = new rxvt_font_x11; 1041 f = new rxvt_font_x11;
1030 1042
1043 f->fs = this;
1031 f->set_term (r); 1044 f->set_term (r);
1032 f->set_name (strdup (name)); 1045 f->set_name (strdup (name));
1033 1046
1034 f->cs = cs; 1047 f->cs = cs;
1035 f->loaded = false; 1048 f->loaded = false;

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines