Stefan Kangas <stefankangas@HIDDEN>
to control <at> debbugs.gnu.org
.
Full text available.Received: (at 76390) by debbugs.gnu.org; 18 Feb 2025 20:33:59 +0000 From debbugs-submit-bounces <at> debbugs.gnu.org Tue Feb 18 15:33:59 2025 Received: from localhost ([127.0.0.1]:34169 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>) id 1tkUI2-00055n-Rk for submit <at> debbugs.gnu.org; Tue, 18 Feb 2025 15:33:59 -0500 Received: from server.qxqx.de ([2a01:4f8:c012:9177::1]:36113 helo=mail.qxqx.de) by debbugs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.84_2) (envelope-from <mail@HIDDEN>) id 1tkUI0-00054v-53 for 76390 <at> debbugs.gnu.org; Tue, 18 Feb 2025 15:33:57 -0500 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=daniel-mendler.de; s=key; h=Content-Type:MIME-Version:Message-ID:Date: References:In-Reply-To:Subject:Cc:To:From:Sender:Reply-To: Content-Transfer-Encoding:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Id: List-Help:List-Unsubscribe:List-Subscribe:List-Post:List-Owner:List-Archive; bh=I1YBCQHoKw2VgAPAnv0jjT3Y/2AvrRMo6YpaDI6J98E=; b=k9Oliu7OEYeQhrnbxIMrd+toyP V9qMz75GEm+E9UTK5yUCePJ8LTOVq6xvLQGDgE3zm/ccNPSDnUYFDqbVnYKvvXWKn3BXMTfMaGiId Erph5Va/uXiqtBjI4Aiyz4/FL3VMUmpm0sASQ7oyZ7MS8cOiopvNaLKLWxmvxl8mK7N0=; From: Daniel Mendler <mail@HIDDEN> To: Eli Zaretskii <eliz@HIDDEN> Subject: Re: bug#76390: [PATCH] Center lines vertically with line-spacing-vertical-center In-Reply-To: <86y0y36mgf.fsf@HIDDEN> (Eli Zaretskii's message of "Tue, 18 Feb 2025 22:13:04 +0200") References: <87tt8r1qnd.fsf@HIDDEN> <86y0y38evn.fsf@HIDDEN> <87tt8r5kio.fsf@HIDDEN> <86h64r89v9.fsf@HIDDEN> <877c5n2kq0.fsf@HIDDEN> <86y0y36mgf.fsf@HIDDEN> Date: Tue, 18 Feb 2025 21:33:48 +0100 Message-ID: <874j0r2dsj.fsf@HIDDEN> User-Agent: Gnus/5.13 (Gnus v5.13) MIME-Version: 1.0 Content-Type: text/plain X-Spam-Score: -0.7 (/) X-Debbugs-Envelope-To: 76390 Cc: 76390 <at> debbugs.gnu.org, stefankangas@HIDDEN X-BeenThere: debbugs-submit <at> debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: <debbugs-submit.debbugs.gnu.org> List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe> List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/> List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org> List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help> List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe> Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org> X-Spam-Score: -1.7 (-) Eli Zaretskii <eliz@HIDDEN> writes: >> I rarely use multiple fonts on a single line. > > I think you underestimate how frequently this happens in routine usage > of Emacs. For example, any Info manual uses different fonts on the > same line, and so do *Help* buffers where they show key bindings. I don't see different fonts in Info or Help in my Emacs setup, but that's probably due to the theme. Key bindings and text uses the same font. However I see different fonts in Eww for example. Daniel
bug-gnu-emacs@HIDDEN
:bug#76390
; Package emacs
.
Full text available.Received: (at 76390) by debbugs.gnu.org; 18 Feb 2025 20:13:20 +0000 From debbugs-submit-bounces <at> debbugs.gnu.org Tue Feb 18 15:13:19 2025 Received: from localhost ([127.0.0.1]:33928 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>) id 1tkTy3-0002uV-BE for submit <at> debbugs.gnu.org; Tue, 18 Feb 2025 15:13:19 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:45184) by debbugs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.84_2) (envelope-from <eliz@HIDDEN>) id 1tkTxz-0002tZ-1O for 76390 <at> debbugs.gnu.org; Tue, 18 Feb 2025 15:13:17 -0500 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 <eliz@HIDDEN>) id 1tkTxs-0002yY-RC; Tue, 18 Feb 2025 15:13:08 -0500 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org; s=fencepost-gnu-org; h=References:Subject:In-Reply-To:To:From:Date: mime-version; bh=n0WBN8hrn2blKS6oHMDHFtKNWd3cw8RrNlDvl0gPz1I=; b=kWKXUSh+K9js LhVPaFgJqThN3i4lWPnPIJp4lpqPthoQosd+H6BRxN7JmLo8USLQunBfv5JaqGIHQ5oK9tCPg0FES ZWlPB/qWYzI/LpZVGftjiyjEyhmR3fxjGlHBWF/k9onpgkjTSHJKmutmre7srTjVd6LdCbt5fiSQ5 jMnB+39A0bvT9mQKo9gzFiwDigT6t/W0I+ltpVl28D18xKkQR4nKDsUTTsvZVvYog+il8xaQIQ2Cx xMXG8HyGgUfpkiixYe54Wu5RBbxZvwO1Pl9ycIaVV+XtsYde/ZEQ6g0S229vJqFSk50SqiDzOBPtZ hwZs4zcthrLSO9IdHidlBQ==; Date: Tue, 18 Feb 2025 22:13:04 +0200 Message-Id: <86y0y36mgf.fsf@HIDDEN> From: Eli Zaretskii <eliz@HIDDEN> To: Daniel Mendler <mail@HIDDEN> In-Reply-To: <877c5n2kq0.fsf@HIDDEN> (message from Daniel Mendler on Tue, 18 Feb 2025 19:04:07 +0100) Subject: Re: bug#76390: [PATCH] Center lines vertically with line-spacing-vertical-center References: <87tt8r1qnd.fsf@HIDDEN> <86y0y38evn.fsf@HIDDEN> <87tt8r5kio.fsf@HIDDEN> <86h64r89v9.fsf@HIDDEN> <877c5n2kq0.fsf@HIDDEN> X-Spam-Score: -2.3 (--) X-Debbugs-Envelope-To: 76390 Cc: 76390 <at> debbugs.gnu.org, stefankangas@HIDDEN X-BeenThere: debbugs-submit <at> debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: <debbugs-submit.debbugs.gnu.org> List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe> List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/> List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org> List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help> List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe> Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org> X-Spam-Score: -3.3 (---) > From: Daniel Mendler <mail@HIDDEN> > Cc: 76390 <at> debbugs.gnu.org, stefankangas@HIDDEN > Date: Tue, 18 Feb 2025 19:04:07 +0100 > > Eli Zaretskii <eliz@HIDDEN> writes: > > > "Good" in that case is in the eyes of the beholder, because the added > > spacing is uniform whatever the font. You say "not good" because I'm > > guessing you don't like the effect in general, not because it breaks > > when different fonts are used on the same screen line. > > Yes, it depends on preference. Therefore I am suggesting to add a > customization option, e.g., `line-spacing-align', or alternatively > extend the `line-spacing' variable as you suggested, such that the > feature must be enabled explicitly. IMO, that'd be the wrong way of adding this feature. We already have two variables (and the corresponding properties) that determine the line height. Adding yet another one to them will make this unnecessarily complicated. The fact that this new option will have no effect unless line-spacing is non-nil doesn't help. > I rarely use multiple fonts on a single line. I think you underestimate how frequently this happens in routine usage of Emacs. For example, any Info manual uses different fonts on the same line, and so do *Help* buffers where they show key bindings.
bug-gnu-emacs@HIDDEN
:bug#76390
; Package emacs
.
Full text available.Received: (at 76390) by debbugs.gnu.org; 18 Feb 2025 18:04:30 +0000 From debbugs-submit-bounces <at> debbugs.gnu.org Tue Feb 18 13:04:30 2025 Received: from localhost ([127.0.0.1]:60895 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>) id 1tkRxN-0000JN-KA for submit <at> debbugs.gnu.org; Tue, 18 Feb 2025 13:04:29 -0500 Received: from server.qxqx.de ([2a01:4f8:c012:9177::1]:39031 helo=mail.qxqx.de) by debbugs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.84_2) (envelope-from <mail@HIDDEN>) id 1tkRxK-0000IV-KD for 76390 <at> debbugs.gnu.org; Tue, 18 Feb 2025 13:04:27 -0500 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=daniel-mendler.de; s=key; h=Content-Type:MIME-Version:Message-ID:Date: References:In-Reply-To:Subject:Cc:To:From:Sender:Reply-To: Content-Transfer-Encoding:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Id: List-Help:List-Unsubscribe:List-Subscribe:List-Post:List-Owner:List-Archive; bh=GyEp6nMQByTw4nRoKwu+Wpru2/DyFEzA1UZ/lGmT85o=; b=FqUhSUOjoL5biy0D6bO26EHfFU cAaqDyCBKDP+tIfjI/YwgbVx2lqlzlvbHSEP+w9sAVfOSFldj9pngg/OGrK6q163s60nsEiMtw9Tw RCGkdh6MVzGUW7cXHT7VoxDUTqhVTAPuJrJWQ73VdD0DSxXI4Xib/kPi1gBvjUw/0weg=; From: Daniel Mendler <mail@HIDDEN> To: Eli Zaretskii <eliz@HIDDEN> Subject: Re: bug#76390: [PATCH] Center lines vertically with line-spacing-vertical-center In-Reply-To: <86h64r89v9.fsf@HIDDEN> (Eli Zaretskii's message of "Tue, 18 Feb 2025 19:02:02 +0200") References: <87tt8r1qnd.fsf@HIDDEN> <86y0y38evn.fsf@HIDDEN> <87tt8r5kio.fsf@HIDDEN> <86h64r89v9.fsf@HIDDEN> Date: Tue, 18 Feb 2025 19:04:07 +0100 Message-ID: <877c5n2kq0.fsf@HIDDEN> User-Agent: Gnus/5.13 (Gnus v5.13) MIME-Version: 1.0 Content-Type: text/plain X-Spam-Score: -0.7 (/) X-Debbugs-Envelope-To: 76390 Cc: 76390 <at> debbugs.gnu.org, stefankangas@HIDDEN X-BeenThere: debbugs-submit <at> debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: <debbugs-submit.debbugs.gnu.org> List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe> List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/> List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org> List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help> List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe> Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org> X-Spam-Score: -1.7 (-) Eli Zaretskii <eliz@HIDDEN> writes: >> From: Daniel Mendler <mail@HIDDEN> >> Cc: 76390 <at> debbugs.gnu.org, stefankangas@HIDDEN >> Date: Tue, 18 Feb 2025 16:40:15 +0100 >> >> Eli Zaretskii <eliz@HIDDEN> writes: >> >> > And finally, I have a question: what does this patch do with a line >> > that mixes different fonts, especially fonts with very different >> > values of ascent and descent? Does the result look well? ISTR that >> > we need to handle the underline property specially due to these >> > considerations, so as to avoid producing broken underline. >> >> I cannot tell yet. I can answer that when I worked a little bit on the >> patch. All I can say confidently is that the status quo with the >> non-centered line-spacing does not look good, not even with a single >> font (see my hi-lock example from above). > > "Good" in that case is in the eyes of the beholder, because the added > spacing is uniform whatever the font. You say "not good" because I'm > guessing you don't like the effect in general, not because it breaks > when different fonts are used on the same screen line. Yes, it depends on preference. Therefore I am suggesting to add a customization option, e.g., `line-spacing-align', or alternatively extend the `line-spacing' variable as you suggested, such that the feature must be enabled explicitly. I rarely use multiple fonts on a single line. But I agree that multiple fonts should be supported well if a `line-spacing-align' patch gets merged, given that some themes use fonts instead of colors for font locking. Stefan Monnier mentioned this in the thread about adding new semantic faces. Daniel
bug-gnu-emacs@HIDDEN
:bug#76390
; Package emacs
.
Full text available.Received: (at 76390) by debbugs.gnu.org; 18 Feb 2025 17:02:18 +0000 From debbugs-submit-bounces <at> debbugs.gnu.org Tue Feb 18 12:02:18 2025 Received: from localhost ([127.0.0.1]:60101 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>) id 1tkQzB-0007Ex-L5 for submit <at> debbugs.gnu.org; Tue, 18 Feb 2025 12:02:17 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:33864) by debbugs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.84_2) (envelope-from <eliz@HIDDEN>) id 1tkQz6-0007EA-FH for 76390 <at> debbugs.gnu.org; Tue, 18 Feb 2025 12:02:15 -0500 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 <eliz@HIDDEN>) id 1tkQyz-0005CU-F6; Tue, 18 Feb 2025 12:02:06 -0500 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org; s=fencepost-gnu-org; h=References:Subject:In-Reply-To:To:From:Date: mime-version; bh=3cR9YQ+0Z4yPvHhEku4z6klEXgd8276wjF8z/kSWc1M=; b=TjDUPy5TZbEy yNzUQ7xgHYXbztO00hVlm3ARnVNpLe7PNIq5tMgf8pTveqlfSGnCjeOWPEc3NhmqVEXo1OyRM/a3G XuuXGY8FIlhzEQwCRQHxSfc5NlW7VzLaYXXlSxxRTfYKJH++UgBFooSkEmRNs6V7L/WM8WaTrz4Ds DAL5IZLQMbkgF6bEE6UtNTwhRSZdP9TzXvhWHapaLqcOd9KV/TTxLJJf8WBqRQKOZugpYZwuMwUev JYyMfKnhn7ONzfH7uH38iVIGxQng9hqX8Tw+vtBZwYHdE5mRKctCp48xSCLxRJSKGc/8/cmMgG/Zi /m89xTm8xbFDijCZ94UuTA==; Date: Tue, 18 Feb 2025 19:02:02 +0200 Message-Id: <86h64r89v9.fsf@HIDDEN> From: Eli Zaretskii <eliz@HIDDEN> To: Daniel Mendler <mail@HIDDEN> In-Reply-To: <87tt8r5kio.fsf@HIDDEN> (message from Daniel Mendler on Tue, 18 Feb 2025 16:40:15 +0100) Subject: Re: bug#76390: [PATCH] Center lines vertically with line-spacing-vertical-center References: <87tt8r1qnd.fsf@HIDDEN> <86y0y38evn.fsf@HIDDEN> <87tt8r5kio.fsf@HIDDEN> X-Spam-Score: -2.3 (--) X-Debbugs-Envelope-To: 76390 Cc: 76390 <at> debbugs.gnu.org, stefankangas@HIDDEN X-BeenThere: debbugs-submit <at> debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: <debbugs-submit.debbugs.gnu.org> List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe> List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/> List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org> List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help> List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe> Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org> X-Spam-Score: -3.3 (---) > From: Daniel Mendler <mail@HIDDEN> > Cc: 76390 <at> debbugs.gnu.org, stefankangas@HIDDEN > Date: Tue, 18 Feb 2025 16:40:15 +0100 > > Eli Zaretskii <eliz@HIDDEN> writes: > > > And finally, I have a question: what does this patch do with a line > > that mixes different fonts, especially fonts with very different > > values of ascent and descent? Does the result look well? ISTR that > > we need to handle the underline property specially due to these > > considerations, so as to avoid producing broken underline. > > I cannot tell yet. I can answer that when I worked a little bit on the > patch. All I can say confidently is that the status quo with the > non-centered line-spacing does not look good, not even with a single > font (see my hi-lock example from above). "Good" in that case is in the eyes of the beholder, because the added spacing is uniform whatever the font. You say "not good" because I'm guessing you don't like the effect in general, not because it breaks when different fonts are used on the same screen line. > I am sure that we can do better in all cases; with a single font or > with multiple fonts of different height. The problem is that if we need to do something with different fonts, it might be impossible to do that in the place in code where the patch makes the changes. Cf what we do with the underline property.
bug-gnu-emacs@HIDDEN
:bug#76390
; Package emacs
.
Full text available.Received: (at 76390) by debbugs.gnu.org; 18 Feb 2025 15:40:30 +0000 From debbugs-submit-bounces <at> debbugs.gnu.org Tue Feb 18 10:40:30 2025 Received: from localhost ([127.0.0.1]:59228 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>) id 1tkPi1-0000ac-JO for submit <at> debbugs.gnu.org; Tue, 18 Feb 2025 10:40:30 -0500 Received: from server.qxqx.de ([2a01:4f8:c012:9177::1]:45535 helo=mail.qxqx.de) by debbugs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.84_2) (envelope-from <mail@HIDDEN>) id 1tkPhw-0000YX-TQ for 76390 <at> debbugs.gnu.org; Tue, 18 Feb 2025 10:40:27 -0500 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=daniel-mendler.de; s=key; h=Content-Type:MIME-Version:Message-ID:Date: References:In-Reply-To:Subject:Cc:To:From:Sender:Reply-To: Content-Transfer-Encoding:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Id: List-Help:List-Unsubscribe:List-Subscribe:List-Post:List-Owner:List-Archive; bh=H3LJQkE2ysbpPSVhZ85r2fOIyamDtQdKHRMFLN3hZV4=; b=EJt/j4BdD7VAjphYrpqFMMjXoS buql5AKwwMiqhNuX0maAfKQm3729LBGo+AFQal6iT+VIgrnn9E067rK8sSUNgGWdUCm7L7JzmAOnI PhmHUUL9aUeTZgwQ6s3xoyln263t2peZbirD+R8GXUGdhGKuIU7zM+nSKNLD+RDP/vmk=; From: Daniel Mendler <mail@HIDDEN> To: Eli Zaretskii <eliz@HIDDEN> Subject: Re: bug#76390: [PATCH] Center lines vertically with line-spacing-vertical-center In-Reply-To: <86y0y38evn.fsf@HIDDEN> (Eli Zaretskii's message of "Tue, 18 Feb 2025 17:13:48 +0200") References: <87tt8r1qnd.fsf@HIDDEN> <86y0y38evn.fsf@HIDDEN> Date: Tue, 18 Feb 2025 16:40:15 +0100 Message-ID: <87tt8r5kio.fsf@HIDDEN> User-Agent: Gnus/5.13 (Gnus v5.13) MIME-Version: 1.0 Content-Type: text/plain X-Spam-Score: -0.7 (/) X-Debbugs-Envelope-To: 76390 Cc: 76390 <at> debbugs.gnu.org, stefankangas@HIDDEN X-BeenThere: debbugs-submit <at> debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: <debbugs-submit.debbugs.gnu.org> List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe> List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/> List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org> List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help> List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe> Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org> X-Spam-Score: -1.7 (-) Eli Zaretskii <eliz@HIDDEN> writes: >> Cc: Stefan Kangas <stefankangas@HIDDEN> >> Date: Tue, 18 Feb 2025 11:41:26 +0100 >> From: Daniel Mendler via "Bug reports for GNU Emacs, >> the Swiss army knife of text editors" <bug-gnu-emacs@HIDDEN> >> >> A few years ago there was a discussion on emacs-devel started by Jesse >> Nazario about vertically centering text for line-spacing > 0. A patch >> was provided back then by Jesse. I hope to revive the discussion and I >> like to provide an updated patch. >> >> Centering text would be particularly useful if the text has a background >> color (e.g., hl-line or hi-lock) as demonstrated by the following steps: >> >> 1. (setq-local line-spacing 0.5) >> 2. (hl-line-mode 1) >> 3. M-x hi-lock-face-symbol-at-point on a symbol at point >> >> The proposal was to add a new variable `line-spacing-vertical-center' to >> enable text centering. Maybe it makes sense to use a more general >> approach which allows finer control over the alignment, e.g., a variable >> `line-spacing-align' which can be set to a floating point number in the >> interval [0.0, 1.0]. The value 0.5 means to center the text, 0.0 means >> to align the text at the top of the line and 1.0 means to align the text >> at the bottom of the line. Fine control over the alignment allows to to >> adjust to fine differences of the font and its baseline alignment. > > Rather than introducing yet another buffer-local knob, I think I'd > prefer extending line-spacing to have a cons cell value (with car > applied to ascent and cdr to descent). This will probably need to add > a new field to the iterator struct. Sounds good. A cons cell for line spacing (ascent . descent) would work. However there is a small concern regarding backward compatibility since some code may expect line-spacing to be only a number or nil. However packages can also be updated and I doubt that there are many which are affected. > Also, we should support the same extension for the line-spacing > property on the newline ending a line (see the node "Line Height" in > the ELisp manual). Agree. > And finally, I have a question: what does this patch do with a line > that mixes different fonts, especially fonts with very different > values of ascent and descent? Does the result look well? ISTR that > we need to handle the underline property specially due to these > considerations, so as to avoid producing broken underline. I cannot tell yet. I can answer that when I worked a little bit on the patch. All I can say confidently is that the status quo with the non-centered line-spacing does not look good, not even with a single font (see my hi-lock example from above). I am sure that we can do better in all cases; with a single font or with multiple fonts of different height. Daniel
bug-gnu-emacs@HIDDEN
:bug#76390
; Package emacs
.
Full text available.Received: (at 76390) by debbugs.gnu.org; 18 Feb 2025 15:14:03 +0000 From debbugs-submit-bounces <at> debbugs.gnu.org Tue Feb 18 10:14:02 2025 Received: from localhost ([127.0.0.1]:59056 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>) id 1tkPIP-0006fx-R8 for submit <at> debbugs.gnu.org; Tue, 18 Feb 2025 10:14:02 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:48724) by debbugs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.84_2) (envelope-from <eliz@HIDDEN>) id 1tkPIM-0006fP-Qx for 76390 <at> debbugs.gnu.org; Tue, 18 Feb 2025 10:13:59 -0500 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 <eliz@HIDDEN>) id 1tkPIF-00065x-T1; Tue, 18 Feb 2025 10:13:51 -0500 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org; s=fencepost-gnu-org; h=References:Subject:In-Reply-To:To:From:Date: mime-version; bh=SVzLjii/6WZJzbZyM+w672JfiDOvTKV1tO1OM4y66YM=; b=f1tpFHQQBCli MKYuGEGmH+oFQuKng9ydgQuOeQHcZOQSxzZKA3dyLmA8Zrh5luShJcY+Nx6KEPYGgtgv+2DIe2/09 luaoZ3prAcncs39M+S1idug3kpn0OR8nnBjhNvJnEb5UMRFHYfJS4LDGvu+Ira55SRDiFGWxeEL9h mYpfYa029txCljIoQDZziG1UuycdQF9B/Hnaci5AmTU8Klh9wOQQPCvBMDGbXmzlqS2rpwTWUlHxo Pr9IxUZJctrPt62h/dijoCBqXZ0JYG+r4IjAEvceDN7MTwAEtQe7aNovMrhGZcbR1xa5Q1d6I+FNO 3NERuZaaSWzpvAofzIL9ow==; Date: Tue, 18 Feb 2025 17:13:48 +0200 Message-Id: <86y0y38evn.fsf@HIDDEN> From: Eli Zaretskii <eliz@HIDDEN> To: Daniel Mendler <mail@HIDDEN> In-Reply-To: <87tt8r1qnd.fsf@HIDDEN> (bug-gnu-emacs@HIDDEN) Subject: Re: bug#76390: [PATCH] Center lines vertically with line-spacing-vertical-center References: <87tt8r1qnd.fsf@HIDDEN> X-Spam-Score: -2.3 (--) X-Debbugs-Envelope-To: 76390 Cc: 76390 <at> debbugs.gnu.org, stefankangas@HIDDEN X-BeenThere: debbugs-submit <at> debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: <debbugs-submit.debbugs.gnu.org> List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe> List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/> List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org> List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help> List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe> Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org> X-Spam-Score: -3.3 (---) > Cc: Stefan Kangas <stefankangas@HIDDEN> > Date: Tue, 18 Feb 2025 11:41:26 +0100 > From: Daniel Mendler via "Bug reports for GNU Emacs, > the Swiss army knife of text editors" <bug-gnu-emacs@HIDDEN> > > A few years ago there was a discussion on emacs-devel started by Jesse > Nazario about vertically centering text for line-spacing > 0. A patch > was provided back then by Jesse. I hope to revive the discussion and I > like to provide an updated patch. > > Centering text would be particularly useful if the text has a background > color (e.g., hl-line or hi-lock) as demonstrated by the following steps: > > 1. (setq-local line-spacing 0.5) > 2. (hl-line-mode 1) > 3. M-x hi-lock-face-symbol-at-point on a symbol at point > > The proposal was to add a new variable `line-spacing-vertical-center' to > enable text centering. Maybe it makes sense to use a more general > approach which allows finer control over the alignment, e.g., a variable > `line-spacing-align' which can be set to a floating point number in the > interval [0.0, 1.0]. The value 0.5 means to center the text, 0.0 means > to align the text at the top of the line and 1.0 means to align the text > at the bottom of the line. Fine control over the alignment allows to to > adjust to fine differences of the font and its baseline alignment. Rather than introducing yet another buffer-local knob, I think I'd prefer extending line-spacing to have a cons cell value (with car applied to ascent and cdr to descent). This will probably need to add a new field to the iterator struct. Also, we should support the same extension for the line-spacing property on the newline ending a line (see the node "Line Height" in the ELisp manual). And finally, I have a question: what does this patch do with a line that mixes different fonts, especially fonts with very different values of ascent and descent? Does the result look well? ISTR that we need to handle the underline property specially due to these considerations, so as to avoid producing broken underline. Thanks.
bug-gnu-emacs@HIDDEN
:bug#76390
; Package emacs
.
Full text available.Received: (at submit) by debbugs.gnu.org; 18 Feb 2025 10:42:02 +0000 From debbugs-submit-bounces <at> debbugs.gnu.org Tue Feb 18 05:42:02 2025 Received: from localhost ([127.0.0.1]:55179 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>) id 1tkL3B-0000AU-7f for submit <at> debbugs.gnu.org; Tue, 18 Feb 2025 05:42:02 -0500 Received: from lists.gnu.org ([2001:470:142::17]:52312) by debbugs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.84_2) (envelope-from <mail@HIDDEN>) id 1tkL36-00009Y-MA for submit <at> debbugs.gnu.org; Tue, 18 Feb 2025 05:41:58 -0500 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 <mail@HIDDEN>) id 1tkL30-0005an-AZ for bug-gnu-emacs@HIDDEN; Tue, 18 Feb 2025 05:41:50 -0500 Received: from server.qxqx.de ([2a01:4f8:c012:9177::1] helo=mail.qxqx.de) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from <mail@HIDDEN>) id 1tkL2x-0001Zv-PV for bug-gnu-emacs@HIDDEN; Tue, 18 Feb 2025 05:41:50 -0500 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=daniel-mendler.de; s=key; h=Content-Type:MIME-Version:Message-ID:Date: Subject:Cc:To:From:Sender:Reply-To:Content-Transfer-Encoding:Content-ID: Content-Description:Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc :Resent-Message-ID:In-Reply-To:References:List-Id:List-Help:List-Unsubscribe: List-Subscribe:List-Post:List-Owner:List-Archive; bh=vBCgjb/Nq/EEN2TDQKUEZB7qsT02U8BZJg6kBpU3snY=; b=BSg3UHGxQESb+uiL2S3eVqCMv+ c4vmEjJb2/W0knBk0v8Xg568JZR4zejRy8vWUMZoXlQ3suy0e5qwNPbIvZkwPnxJvI6KlR+yDyIM2 DSww5Y3uxht7ch+zj7BOHNaMfc/dq3o+dE7awNtqOuixlsQ3LNGigfDlDI6S/NU+ygZg=; From: Daniel Mendler <mail@HIDDEN> To: bug-gnu-emacs@HIDDEN Subject: [PATCH] Center lines vertically with line-spacing-vertical-center Date: Tue, 18 Feb 2025 11:41:26 +0100 Message-ID: <87tt8r1qnd.fsf@HIDDEN> MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" Received-SPF: pass client-ip=2a01:4f8:c012:9177::1; envelope-from=mail@HIDDEN; helo=mail.qxqx.de X-Spam_score_int: -27 X-Spam_score: -2.8 X-Spam_bar: -- X-Spam_report: (-2.8 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_LOW=-0.7, SPF_HELO_PASS=-0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-Spam-Score: 0.9 (/) X-Debbugs-Envelope-To: submit Cc: Stefan Kangas <stefankangas@HIDDEN> X-BeenThere: debbugs-submit <at> debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: <debbugs-submit.debbugs.gnu.org> List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe> List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/> List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org> List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help> List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe> Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org> X-Spam-Score: -0.1 (/) --=-=-= Content-Type: text/plain Tags: patch A few years ago there was a discussion on emacs-devel started by Jesse Nazario about vertically centering text for line-spacing > 0. A patch was provided back then by Jesse. I hope to revive the discussion and I like to provide an updated patch. Centering text would be particularly useful if the text has a background color (e.g., hl-line or hi-lock) as demonstrated by the following steps: 1. (setq-local line-spacing 0.5) 2. (hl-line-mode 1) 3. M-x hi-lock-face-symbol-at-point on a symbol at point The proposal was to add a new variable `line-spacing-vertical-center' to enable text centering. Maybe it makes sense to use a more general approach which allows finer control over the alignment, e.g., a variable `line-spacing-align' which can be set to a floating point number in the interval [0.0, 1.0]. The value 0.5 means to center the text, 0.0 means to align the text at the top of the line and 1.0 means to align the text at the bottom of the line. Fine control over the alignment allows to to adjust to fine differences of the font and its baseline alignment. The old discussion can be found at: https://lists.gnu.org/archive/html/emacs-devel/2019-09/msg00660.html I attached the latest patch from the old discussion to this report. --=-=-= Content-Type: text/patch Content-Disposition: attachment; filename=centering-text.patch From 9bc5cbb727e5dcac9f774028858e2608d1a23033 Mon Sep 17 00:00:00 2001 From: Jesse Nazario <address@hidden> Date: Sun, 8 Sep 2019 20:06:15 -0300 Subject: [PATCH] Center lines vertically with line-spacing-vertical-center When using line-spacing, the new variable line-spacing-vertical-center can be set to non-nil to center the line content vertically. --- doc/lispref/display.texi | 5 +++++ etc/NEWS | 4 ++++ src/buffer.c | 14 ++++++++++++++ src/buffer.h | 4 ++++ src/xdisp.c | 10 +++++++++- 5 files changed, 36 insertions(+), 1 deletion(-) diff --git a/doc/lispref/display.texi b/doc/lispref/display.texi index fd6820897f..875c50c6ef 100644 --- a/doc/lispref/display.texi +++ b/doc/lispref/display.texi @@ -2195,6 +2195,11 @@ Line Height number of pixels put below lines. A floating-point number specifies the spacing relative to the frame's default line height. + The @code{line-spacing} parameter creates the space by putting some +margin only below the line. If you wish to center the line vertically +instead, you can set the variable @code{line-spacing-vertical-center} +as non-nin. + @vindex line-spacing You can specify the line spacing for all lines in a buffer via the buffer-local @code{line-spacing} variable. An integer specifies diff --git a/etc/NEWS b/etc/NEWS index cb8b6fcac1..3209f2535f 100644 --- a/etc/NEWS +++ b/etc/NEWS @@ -445,6 +445,10 @@ RGB triplets with a single hexadecimal digit per component. --- ** The toolbar now shows the equivalent key binding in its tooltips. +** New variable line-spacing-vertical-center. +This variable, if non-nil, centers the line content vertically when +using the 'line-spacing' variable. + * Editing Changes in Emacs 27.1 diff --git a/src/buffer.c b/src/buffer.c index 77e8b6bb77..854b3924c0 100644 --- a/src/buffer.c +++ b/src/buffer.c @@ -219,6 +219,11 @@ bset_extra_line_spacing (struct buffer *b, Lisp_Object val) b->extra_line_spacing_ = val; } static void +bset_line_spacing_vertical_center (struct buffer *b, Lisp_Object val) +{ + b->line_spacing_vertical_center_ = val; +} +static void bset_file_format (struct buffer *b, Lisp_Object val) { b->file_format_ = val; @@ -962,6 +967,8 @@ reset_buffer (register struct buffer *b) (b, BVAR (&buffer_defaults, enable_multibyte_characters)); bset_cursor_type (b, BVAR (&buffer_defaults, cursor_type)); bset_extra_line_spacing (b, BVAR (&buffer_defaults, extra_line_spacing)); + bset_line_spacing_vertical_center (b, BVAR (&buffer_defaults, + line_spacing_vertical_center)); b->display_error_modiff = 0; } @@ -5196,6 +5203,7 @@ init_buffer_once (void) XSETFASTINT (BVAR (&buffer_local_flags, header_line_format), idx); ++idx; XSETFASTINT (BVAR (&buffer_local_flags, cursor_type), idx); ++idx; XSETFASTINT (BVAR (&buffer_local_flags, extra_line_spacing), idx); ++idx; + XSETFASTINT (BVAR (&buffer_local_flags, line_spacing_vertical_center), idx); ++idx; XSETFASTINT (BVAR (&buffer_local_flags, cursor_in_non_selected_windows), idx); ++idx; /* buffer_local_flags contains no pointers, so it's safe to treat it @@ -5265,6 +5273,7 @@ init_buffer_once (void) bset_bidi_paragraph_separate_re (&buffer_defaults, Qnil); bset_cursor_type (&buffer_defaults, Qt); bset_extra_line_spacing (&buffer_defaults, Qnil); + bset_line_spacing_vertical_center (&buffer_defaults, Qnil); bset_cursor_in_non_selected_windows (&buffer_defaults, Qt); bset_enable_multibyte_characters (&buffer_defaults, Qt); @@ -6254,6 +6263,11 @@ from (abs POSITION). If POSITION is positive, point was at the front If value is a floating point number, it specifies the spacing relative to the default frame line height. A value of nil means add no extra space. */); + DEFVAR_PER_BUFFER ("line-spacing-vertical-center", + &BVAR (current_buffer, line_spacing_vertical_center), Qnil, + doc: /* Non-nil means center the line content vertically +when using `line-spacing' variable. */); + DEFVAR_PER_BUFFER ("cursor-in-non-selected-windows", &BVAR (current_buffer, cursor_in_non_selected_windows), Qnil, doc: /* Non-nil means show a cursor in non-selected windows. diff --git a/src/buffer.h b/src/buffer.h index 280d4e9098..d7cb27305e 100644 --- a/src/buffer.h +++ b/src/buffer.h @@ -549,6 +549,10 @@ #define BVAR(buf, field) ((buf)->field ## _) in the display of this buffer. */ Lisp_Object extra_line_spacing_; + /* Non-nil means center the line content vertically. To be used + along with `line-spacing'. */ + Lisp_Object line_spacing_vertical_center_; + /* Cursor type to display in non-selected windows. t means to use hollow box cursor. See `cursor-type' for other values. */ diff --git a/src/xdisp.c b/src/xdisp.c index 95895ec3ac..e2c7309f32 100644 --- a/src/xdisp.c +++ b/src/xdisp.c @@ -29307,7 +29307,15 @@ gui_produce_glyphs (struct it *it) if (extra_line_spacing > 0) { - it->descent += extra_line_spacing; + if (! NILP (BVAR (XBUFFER (it->w->contents), + line_spacing_vertical_center))) + it->descent += extra_line_spacing; + else + { + int spacing = extra_line_spacing / 2; + it->ascent += spacing; + it->descent += spacing; + } if (extra_line_spacing > it->max_extra_line_spacing) it->max_extra_line_spacing = extra_line_spacing; } -- 2.23.0 --=-=-=--
Daniel Mendler <mail@HIDDEN>
:bug-gnu-emacs@HIDDEN
.
Full text available.bug-gnu-emacs@HIDDEN
:bug#76390
; Package emacs
.
Full text available.
GNU bug tracking system
Copyright (C) 1999 Darren O. Benham,
1997 nCipher Corporation Ltd,
1994-97 Ian Jackson.