From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Eli Zaretskii Newsgroups: gmane.emacs.devel Subject: Re: Text shadows Date: Sun, 12 Mar 2023 09:12:33 +0200 Message-ID: <83mt4iv3xa.fsf@gnu.org> References: <72650A07-DEC8-4E08-A524-5C7AF804F3CB@gmail.com> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="18625"; mail-complaints-to="usenet@ciao.gmane.io" Cc: emacs-devel@gnu.org To: Kai Ma Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Sun Mar 12 08:13:37 2023 Return-path: Envelope-to: ged-emacs-devel@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1pbFth-0004h9-47 for ged-emacs-devel@m.gmane-mx.org; Sun, 12 Mar 2023 08:13:37 +0100 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1pbFsu-0008Pb-LO; Sun, 12 Mar 2023 03:12:48 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1pbFss-0008PM-Kp for emacs-devel@gnu.org; Sun, 12 Mar 2023 03:12:46 -0400 Original-Received: from fencepost.gnu.org ([2001:470:142:3::e]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1pbFss-0002bu-5p; Sun, 12 Mar 2023 03:12:46 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org; s=fencepost-gnu-org; h=MIME-version:References:Subject:In-Reply-To:To:From: Date; bh=bjhuMUYyFk8LCfVxUFgYW56a8iNnrfyaImyLMUmn7AU=; b=f+mR5kjOdEy+KYS9toPs c9b0W+qTTOtmDyGoh24PkZuRe3I6WDvFqpD+At4LRKzSa2DOTolgnQJXj9cPXuQfOJFv4upKHW5aP z5ZJMyVtxZ+awF904VN9GUWxzBjHmkDv+Vi+1soWKhplS7U4TcDenLqQfzC/DWEkxX+rJsiXNdBkT mawjc0//GTsRRzCP6LJTvGM3P2/g0Fol22ZQVf2iltK8OzlAYfkCFro+H/LWVY8KKc2KKGfx4BMIy cPKfYd/vqC2mvBtZVRNY5TtxyFL5Dg6RMHyPrKu4IyWLdcB9qprO85LR4C8cMQIJjRvmwm50/eV4J PDi6xsqUIVZfXA==; Original-Received: from [87.69.77.57] (helo=home-c4e4a596f7) by fencepost.gnu.org with esmtpsa (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1pbFsr-0003vN-Fg; Sun, 12 Mar 2023 03:12:45 -0400 In-Reply-To: <72650A07-DEC8-4E08-A524-5C7AF804F3CB@gmail.com> (message from Kai Ma on Sun, 12 Mar 2023 12:06:28 +0800) X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Original-Sender: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Xref: news.gmane.io gmane.emacs.devel:304353 Archived-At: > From: Kai Ma > Date: Sun, 12 Mar 2023 12:06:28 +0800 > > Recently, I implemented the “text shadows” feature for Cairo-powered windowing systems, including X11 and Wayland. See [1] if you wonder what that looks like. Which parts of the feature implementation really require Cairo? IOW, why cannot this be available to non-Cairo builds as well? > This feature adds a new face attribute :shadow, and accepts values like: > > - FLOAT how much blurring? > - (FLOAT . COLOR) additionally, specifies a color for the shadow > - (FLOAT COLOR OFFSET) additionally, specifies an offset (x . y) I think at least in some GUI systems the offset is specified as radius and angle. > I’m writing to ask if the community is interested in accepting this feature into mainline Emacs? If so, I will improve things and make a formal patch. Yes, I think we'd like to support this feature. But it looks to me like the current WIP is incomplete, as it doesn't handle the change in glyph metrics due to the shadowing, see below. It is best to submit a feature-request bug report using report-emacs-bug, and then continue the discussion on our issue tracker. > 1. The shadows sometimes should be drawn outside the glyph extents, but they aren’t drawn. > 2. Previously drawn shadows are not cleared, and they even accumulate. This can be observed with blink-cursor-mode enabled. This probably means you need further changes in the layout part of the display code, in xdisp.c, to account for the changes in the glyph metrics due to the shadow attribute. See, for example, how the 'box' face attribute is handled there.