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.31 by pcg, Thu Mar 4 00:40:06 2004 UTC vs.
Revision 1.37 by pcg, Fri Mar 5 05:52:02 2004 UTC

275 275
276 bool has_codepoint (uint32_t unicode) 276 bool has_codepoint (uint32_t unicode)
277 { 277 {
278 if (unicode <= 0x001f) 278 if (unicode <= 0x001f)
279 return true; 279 return true;
280
280 if (unicode >= 0x0080 && unicode <= 0x009f) 281 if (unicode >= 0x0080 && unicode <= 0x009f)
281 return true; 282 return true;
282 283
283 if (unicode >= 0x2500 && unicode <= 0x257f 284 if (unicode >= 0x2500 && unicode <= 0x257f
284 && linedraw_cmds[unicode - 0x2500]) 285 && linedraw_cmds[unicode - 0x2500])
286 return true;
287
288 if (IS_COMPOSE (unicode))
285 return true; 289 return true;
286 290
287 switch (unicode) 291 switch (unicode)
288 { 292 {
289 case ZERO_WIDTH_CHAR: 293 case ZERO_WIDTH_CHAR:
307 311
308 XSetForeground (d.display->display, GC, r->PixColors[fg]); 312 XSetForeground (d.display->display, GC, r->PixColors[fg]);
309 313
310 while (len--) 314 while (len--)
311 { 315 {
316 compose_char *cc;
312 text_t t = *text++; 317 text_t t = *text++;
313 318
314 // is it in our linedrawing table? 319 // is it in our linedrawing table?
315 if (t >= 0x2500 & t <= 0x2580 && linedraw_cmds[t - 0x2500]) 320 if (t >= 0x2500 & t <= 0x2580 && linedraw_cmds[t - 0x2500])
316 { 321 {
344 } 349 }
345 } 350 }
346 351
347 gcv.line_width = 0; 352 gcv.line_width = 0;
348 XChangeGC (d.display->display, GC, GCLineWidth, &gcv); 353 XChangeGC (d.display->display, GC, GCLineWidth, &gcv);
354 }
355 else if (IS_COMPOSE (t) && (cc = rxvt_composite[t]))
356 {
357 rxvt_font *f1 = (*fs)[fs->find_font (cc->c1)];
358 f1->draw (d, x, y, &(t = cc->c1), 1, fg, bg);
359 if (cc->c2 != NOCHAR)
360 {
361 // prefer font of first character, for no good reasons
362 rxvt_font *f2 = f1->has_codepoint (cc->c2)
363 ? f1
364 : (*fs)[fs->find_font (cc->c2)];
365
366 f2->draw (d, x, y, &(t = cc->c2), 1, fg, -1);
367 }
349 } 368 }
350 else 369 else
351 switch (t) 370 switch (t)
352 { 371 {
353 case ZERO_WIDTH_CHAR: 372 case ZERO_WIDTH_CHAR:
1017 f = new rxvt_font_x11; 1036 f = new rxvt_font_x11;
1018 } 1037 }
1019 else 1038 else
1020 f = new rxvt_font_x11; 1039 f = new rxvt_font_x11;
1021 1040
1041 f->fs = this;
1022 f->set_term (r); 1042 f->set_term (r);
1023 f->set_name (strdup (name)); 1043 f->set_name (strdup (name));
1024 1044
1025 f->cs = cs; 1045 f->cs = cs;
1026 f->loaded = false; 1046 f->loaded = false;

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines