emacs-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

"Bold" effect when anti-aliased glyphs are overwritten


From: Chong Yidong
Subject: "Bold" effect when anti-aliased glyphs are overwritten
Date: Tue, 27 May 2008 13:51:34 -0400

I've been noticing that glyphs near the cursor occasionally become
"bold" for no reason.  Here's a way to reproduce it:

(defun glyph-test ()
  (interactive)
  (switch-to-buffer "*Test*")
  (erase-buffer)
  (insert "\n ABC")
  (goto-char (point-min)))

M-x glyph-test RET
[down]

The first glyph on the second line, displaying the character "A", now
becomes a little bolder.  Now do

[up]
[down]

Each time, the "A" gets bolder and bolder.

This might depend on the exact font you use (mine is Mono-10).

The reason this happens is that when the redisplay engine calls
draw_glyphs to draw certain glyphs, such as the cursor glyph,
neighboring glyphs are redrawn if there is a left or right overhang
(xdisp.c:19929).

Currently, the foreground of these redrawn glyphs is drawn directly
without erasing the existing glyph.  This is because we generally don't
want to redraw the background, since that might in turn overwrite THIS
glyph's neighbors.  Without anti-aliasing, this procedure is obviously
unproblematic.

With anti-aliasing, it doesn't work well.  Apparently, during the
anti-aliasing calculation, the entire existing glyph---including the
glyph foreground---is treated as the "background".  Thus, the
anti-aliased parts of the foreground character becomes more and more
prominent, and eventually saturates completely.

Does anyone have any ideas for fixing this?




reply via email to

[Prev in Thread] Current Thread [Next in Thread]