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.41 by pcg, Mon Mar 15 01:27:46 2004 UTC vs.
Revision 1.42 by pcg, Mon Mar 15 06:13:35 2004 UTC

201#endif 201#endif
202 } 202 }
203} 203}
204 204
205static const char *linedraw_cmds[128] = { 205static const char *linedraw_cmds[128] = {
206 "1hH", "2hH", "1vV", "2vV", 206 "1-", "2-", "1|", "2|",
207 0, 0, 0, 0, 207 0, 0, 0, 0,
208 0, 0, 0, 0, 208 0, 0, 0, 0,
209 "1HV", "2H1V", "1H2V", "2HV", 209 "1HV", "2H1V", "1H2V", "2HV",
210 210
211 // 2510 211 // 2510
212 "1hV", "2h1V", "1h2V", "2hV", 212 "1hV", "2h1V", "1h2V", "2hV",
213 "1Hv", "2H1v", "1H2v", "2Hv", 213 "1Hv", "2H1v", "1H2v", "2Hv",
214 "1hv", "2h1v", "1h2v", "2hv", 214 "1hv", "2h1v", "1h2v", "2hv",
215 "1HvV", "2H1vV", "1HV2v", "1Hv2V", 215 "1H|", "2H1|", "1HV2v", "1Hv2V",
216 216
217 // 2520 217 // 2520
218 "1H2vV", "2Hv1V", "2HV1v", "2HvV", 218 "1H2|", "2Hv1V", "2HV1v", "2H|",
219 "1hvV", "2h1vV", "1hV2v", "1hv2V", 219 "1h|", "2h1|", "1hV2v", "1hv2V",
220 "1h2vV", "2hv1V", "1v2hV", "2hvV", 220 "1h2|", "2hv1V", "1v2hV", "2h|",
221 "1hHV", "2h1HV", "2H1hV", "2hH1V", 221 "1-V", "2h1HV", "2H1hV", "2-1V",
222 222
223 // 2530 223 // 2530
224 "1hH2V", "2hV1H", "1h2HV", "2hHV", 224 "1-2V", "2hV1H", "1h2HV", "2-V",
225 "1hHv", "1vH2h", "1hv2H", "1v2hH", 225 "1-v", "1vH2h", "1hv2H", "1v2-",
226 "1hH2v", "1H2hv", "1h2Hv", "2hHv", 226 "1-2v", "1H2hv", "1h2Hv", "2-v",
227 "1hHvV", "1vVH2h", "1hvV2H", "1vV2hH", 227 "1-|", "1|H2h", "1h|2H", "1|2-",
228 228
229 // 2540 229 // 2540
230 "1hHV2v", "1hHv2V", "1hH2vV", "1HV2hv", 230 "1-V2v", "1-v2V", "1-2|", "1HV2hv",
231 "1hV2Hv", "1Hv2hV", "1hv2HV", "1V2hHv", 231 "1hV2Hv", "1Hv2hV", "1hv2HV", "1V2-v",
232 "1v2hHV", "1H2hvV", "1h2HvV", "2hHvV", 232 "1v2-V", "1H2h|", "1h2H|", "2-|",
233 0, 0, 0, 0, 233 0, 0, 0, 0,
234 234
235 // 2550 235 // 2550
236 0, 0, 0, 0, 236 0, 0, 0, 0,
237 0, 0, 0, 0, 237 0, 0, 0, 0,
240 240
241 // 2560 241 // 2560
242 0, 0, 0, 0, 242 0, 0, 0, 0,
243 0, 0, 0, 0, 243 0, 0, 0, 0,
244 0, 0, 0, 0, 244 0, 0, 0, 0,
245 0, 0, 0, 0, 245 0, "A", "B", "C",
246 246
247 // 2570 247 // 2570
248 0, "1a", "1b", "1ab", 248 "D", "1/", "1\\", "1/\\",
249 "1h", "1v", "1H", "1V", 249 "1h", "1v", "1H", "1V",
250 "2h", "2v", "2H", "2V", 250 "2h", "2v", "2H", "2V",
251 "1h2H", "1v2V", "1H2h", "1V2v" 251 "1h2H", "1v2V", "1H2h", "1V2v"
252 252
253 // to be done 253 // to be done
323 // is it in our linedrawing table? 323 // is it in our linedrawing table?
324 if (t >= 0x2500 & t <= 0x2580 && linedraw_cmds[t - 0x2500]) 324 if (t >= 0x2500 & t <= 0x2580 && linedraw_cmds[t - 0x2500])
325 { 325 {
326 const char *p = linedraw_cmds[t - 0x2500]; 326 const char *p = linedraw_cmds[t - 0x2500];
327 327
328 int x0 = x, x1 = x + (r->TermWin.fwidth - 1) / 2, x2 = x + r->TermWin.fwidth - 1; 328 int W = r->TermWin.fwidth , w = (W - 1) / 2;
329 int y0 = y, y1 = y + (r->TermWin.fheight - 1) / 2, y2 = y + r->TermWin.fheight - 1; 329 int H = r->TermWin.fheight, h = (H - 1) / 2;
330 int x0 = x, x1 = x + w, x2 = x + r->TermWin.fwidth ;
331 int y0 = y, y1 = y + h, y2 = y + r->TermWin.fheight;
330 332
331 XGCValues gcv; 333 XGCValues gcv;
334
335 gcv.cap_style = CapNotLast;
336 XChangeGC (d.display->display, GC, GCCapStyle, &gcv);
332 337
333 while (*p) 338 while (*p)
334 { 339 {
335 switch (*p++) 340 switch (*p++)
336 { 341 {
338 gcv.line_width = 0; 343 gcv.line_width = 0;
339 XChangeGC (d.display->display, GC, GCLineWidth, &gcv); 344 XChangeGC (d.display->display, GC, GCLineWidth, &gcv);
340 break; 345 break;
341 346
342 case '2': 347 case '2':
343 gcv.line_width = 2; 348 gcv.line_width = 3;
344 XChangeGC (d.display->display, GC, GCLineWidth, &gcv); 349 XChangeGC (d.display->display, GC, GCLineWidth, &gcv);
345 break; 350 break;
346 351
347 case 'h': XDrawLine (d.display->display, d, GC, x0, y1, x1, y1); break; 352 case 'h': XDrawLine (d.display->display, d, GC, x0, y1, x1+1, y1 ); break;
348 case 'H': XDrawLine (d.display->display, d, GC, x1, y1, x2, y1); break; 353 case 'H': XDrawLine (d.display->display, d, GC, x2, y1, x1-1, y1 ); break;
354 case '-': XDrawLine (d.display->display, d, GC, x0, y1, x2 , y1 ); break;
349 case 'v': XDrawLine (d.display->display, d, GC, x1, y0, x1, y1); break; 355 case 'v': XDrawLine (d.display->display, d, GC, x1, y0, x1 , y1+1); break;
356 case 'V': XDrawLine (d.display->display, d, GC, x1, y2, x1 , y1-1); break;
350 case 'V': XDrawLine (d.display->display, d, GC, x1, y1, x1, y2); break; 357 case '|': XDrawLine (d.display->display, d, GC, x1, y0, x1 , y2 ); break;
358
351 case 'a': XDrawLine (d.display->display, d, GC, x0, y2, x2, y0); break; 359 case '/' : XDrawLine (d.display->display, d, GC, x0, y2, x2 , y0 ); break;
352 case 'b': XDrawLine (d.display->display, d, GC, x0, y0, x2, y2); break; 360 case '\\': XDrawLine (d.display->display, d, GC, x0, y0, x2 , y2 ); break;
361
362 case 'A': XDrawArc (d.display->display, d, GC, x1 , y1 , W-1, H-1, 90*64, 90*64); break;
363 case 'B': XDrawArc (d.display->display, d, GC, x1-W+1, y1 , W-1, H-1, 0*64, 90*64); break;
364 case 'C': XDrawArc (d.display->display, d, GC, x1-W+1, y1-H+1, W-1, H-1, 0*64, -90*64); break;
365 case 'D': XDrawArc (d.display->display, d, GC, x1 , y1-H+1, W-1, H-1, -90*64, -90*64); break;
353 } 366 }
354 } 367 }
355 368
356 gcv.line_width = 0; 369 gcv.line_width = 0;
357 XChangeGC (d.display->display, GC, GCLineWidth, &gcv); 370 XChangeGC (d.display->display, GC, GCLineWidth, &gcv);
358 } 371 }
372
359#if ENABLE_COMBINING 373#if ENABLE_COMBINING
360 else if (IS_COMPOSE (t) && (cc = rxvt_composite[t])) 374 else if (IS_COMPOSE (t) && (cc = rxvt_composite[t]))
361 { 375 {
362 rxvt_font *f1 = (*fs)[fs->find_font (cc->c1)]; 376 rxvt_font *f1 = (*fs)[fs->find_font (cc->c1)];
363 f1->draw (d, x, y, &(t = cc->c1), 1, fg, bg); 377 f1->draw (d, x, y, &(t = cc->c1), 1, fg, bg);

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines