diff options
| author | Jim Blandy | 1993-05-14 14:44:26 +0000 |
|---|---|---|
| committer | Jim Blandy | 1993-05-14 14:44:26 +0000 |
| commit | 4a4dc352d55f6ab7f8a3c7941ef0238caf2075ba (patch) | |
| tree | e053acd485ff94e132a42573dc98af0d6189181a /src | |
| parent | f6b98e0be9be1c213281df3edf774b3ae909afa4 (diff) | |
| download | emacs-4a4dc352d55f6ab7f8a3c7941ef0238caf2075ba.tar.gz emacs-4a4dc352d55f6ab7f8a3c7941ef0238caf2075ba.zip | |
* xterm.c (dumpglyphs): Give the cursor higher priority than the
face specified by the glyph under it.
* xterm.c (dumpglyphs): Move the underline up a row. I dislike
the way X addresses pixels. Quickdraw is much nicer.
* xterm.c (dumpglyphs): Pass the proper arguments to intern_face.
* xterm.c (dumpglyphs): Don't increment left twice.
Diffstat (limited to 'src')
| -rw-r--r-- | src/xterm.c | 24 |
1 files changed, 14 insertions, 10 deletions
diff --git a/src/xterm.c b/src/xterm.c index 97ebb079acf..58733c1efa3 100644 --- a/src/xterm.c +++ b/src/xterm.c | |||
| @@ -457,7 +457,14 @@ dumpglyphs (f, left, top, gp, n, hl) | |||
| 457 | FONT_TYPE *font = FACE_FONT (face); | 457 | FONT_TYPE *font = FACE_FONT (face); |
| 458 | GC gc = FACE_GC (face); | 458 | GC gc = FACE_GC (face); |
| 459 | 459 | ||
| 460 | if (cf != 0) | 460 | /* Cursor display take full precidence. */ |
| 461 | if (hl == 2) | ||
| 462 | { | ||
| 463 | gc = (f->display.x->cursor_gc); | ||
| 464 | } | ||
| 465 | |||
| 466 | /* Then comes faces of the text itself. */ | ||
| 467 | else if (cf != 0) | ||
| 461 | { | 468 | { |
| 462 | /* The face codes on the glyphs must be valid indices into the | 469 | /* The face codes on the glyphs must be valid indices into the |
| 463 | frame's face table. */ | 470 | frame's face table. */ |
| @@ -467,10 +474,12 @@ dumpglyphs (f, left, top, gp, n, hl) | |||
| 467 | if (cf == 1) | 474 | if (cf == 1) |
| 468 | face = FRAME_MODE_LINE_FACE (f); | 475 | face = FRAME_MODE_LINE_FACE (f); |
| 469 | else | 476 | else |
| 470 | face = intern_face (FRAME_FACES (f) [cf]); | 477 | face = intern_face (f, FRAME_FACES (f) [cf]); |
| 471 | font = FACE_FONT (face); | 478 | font = FACE_FONT (face); |
| 472 | gc = FACE_GC (face); | 479 | gc = FACE_GC (face); |
| 473 | } | 480 | } |
| 481 | |||
| 482 | /* Then comes the distinction between modeline and normal text. */ | ||
| 474 | else if (hl == 0) | 483 | else if (hl == 0) |
| 475 | ; | 484 | ; |
| 476 | else if (hl == 1) | 485 | else if (hl == 1) |
| @@ -479,23 +488,18 @@ dumpglyphs (f, left, top, gp, n, hl) | |||
| 479 | font = FACE_FONT (face); | 488 | font = FACE_FONT (face); |
| 480 | gc = FACE_GC (face); | 489 | gc = FACE_GC (face); |
| 481 | } | 490 | } |
| 482 | else if (hl == 2) | ||
| 483 | { | ||
| 484 | gc = (f->display.x->cursor_gc); | ||
| 485 | } | ||
| 486 | 491 | ||
| 487 | XDrawImageString (x_current_display, window, gc, | 492 | XDrawImageString (x_current_display, window, gc, |
| 488 | left, top + FONT_BASE (font), buf, len); | 493 | left, top + FONT_BASE (font), buf, len); |
| 489 | left += len * FONT_WIDTH (font); | ||
| 490 | 494 | ||
| 491 | /* We should probably check for XA_UNDERLINE_POSITION and | 495 | /* We should probably check for XA_UNDERLINE_POSITION and |
| 492 | XA_UNDERLINE_THICKNESS properties on the font, but let's | 496 | XA_UNDERLINE_THICKNESS properties on the font, but let's |
| 493 | just get the thing working, and come back to that. */ | 497 | just get the thing working, and come back to that. */ |
| 494 | { | 498 | { |
| 495 | int underline_position = 2; | 499 | int underline_position = 1; |
| 496 | 500 | ||
| 497 | if (font->descent < underline_position) | 501 | if (font->descent <= underline_position) |
| 498 | underline_position = font->descent; | 502 | underline_position = font->descent - 1; |
| 499 | 503 | ||
| 500 | if (face->underline) | 504 | if (face->underline) |
| 501 | XFillRectangle (x_current_display, FRAME_X_WINDOW (f), | 505 | XFillRectangle (x_current_display, FRAME_X_WINDOW (f), |