all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Chong Yidong <cyd@stupidchicken.com>
To: emacs-devel@gnu.org
Subject: "Bold" effect when anti-aliased glyphs are overwritten
Date: Tue, 27 May 2008 13:51:34 -0400	[thread overview]
Message-ID: <87ve0zmy8p.fsf@stupidchicken.com> (raw)

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	other threads:[~2008-05-27 17:51 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-05-27 17:51 Chong Yidong [this message]
2008-05-27 21:09 ` "Bold" effect when anti-aliased glyphs are overwritten Chong Yidong
2008-05-28  8:49   ` Stephen Berman
2008-05-27 21:18 ` Jason Rumney
2008-05-27 21:21   ` Chong Yidong
2008-05-28  2:21     ` Kenichi Handa
2008-05-28  0:30 ` Kenichi Handa

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=87ve0zmy8p.fsf@stupidchicken.com \
    --to=cyd@stupidchicken.com \
    --cc=emacs-devel@gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.