From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Chong Yidong Newsgroups: gmane.emacs.devel Subject: "Bold" effect when anti-aliased glyphs are overwritten Date: Tue, 27 May 2008 13:51:34 -0400 Message-ID: <87ve0zmy8p.fsf@stupidchicken.com> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: ger.gmane.org 1211910966 842 80.91.229.12 (27 May 2008 17:56:06 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Tue, 27 May 2008 17:56:06 +0000 (UTC) To: emacs-devel@gnu.org Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Tue May 27 19:56:47 2008 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by lo.gmane.org with esmtp (Exim 4.50) id 1K13PY-0001Ee-Nu for ged-emacs-devel@m.gmane.org; Tue, 27 May 2008 19:56:37 +0200 Original-Received: from localhost ([127.0.0.1]:44238 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1K13On-0002p4-IH for ged-emacs-devel@m.gmane.org; Tue, 27 May 2008 13:55:49 -0400 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1K13Oj-0002ok-Ps for emacs-devel@gnu.org; Tue, 27 May 2008 13:55:45 -0400 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1K13Oi-0002oA-85 for emacs-devel@gnu.org; Tue, 27 May 2008 13:55:45 -0400 Original-Received: from [199.232.76.173] (port=57138 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1K13Oi-0002o7-0J for emacs-devel@gnu.org; Tue, 27 May 2008 13:55:44 -0400 Original-Received: from cyd.mit.edu ([18.115.2.24]:45023) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1K13Oh-00023A-Oc for emacs-devel@gnu.org; Tue, 27 May 2008 13:55:43 -0400 Original-Received: by cyd.mit.edu (Postfix, from userid 1000) id 0035E4E2E6; Tue, 27 May 2008 13:51:34 -0400 (EDT) X-detected-kernel: by monty-python.gnu.org: Linux 2.6 (newer, 2) X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.devel:97814 Archived-At: 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?