From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED.blaine.gmane.org!not-for-mail From: Eli Zaretskii Newsgroups: gmane.emacs.bugs Subject: bug#38485: Customizing glyph widths Date: Wed, 04 Dec 2019 17:52:12 +0200 Message-ID: <83y2vshyvn.fsf@gnu.org> References: <3183ba6c-6aea-fa25-bb32-7e5ff7c04ad6@gmail.com> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit Injection-Info: blaine.gmane.org; posting-host="blaine.gmane.org:195.159.176.226"; logging-data="259130"; mail-complaints-to="usenet@blaine.gmane.org" Cc: 38485@debbugs.gnu.org To: =?UTF-8?Q?Cl=C3=A9ment?= Pit-Claudel , Yuan Fu Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Wed Dec 04 17:10:49 2019 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([209.51.188.17]) by blaine.gmane.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.89) (envelope-from ) id 1icXEn-0015J1-4y for geb-bug-gnu-emacs@m.gmane.org; Wed, 04 Dec 2019 17:10:49 +0100 Original-Received: from localhost ([::1]:40826 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1icXEk-0004Ly-Lq for geb-bug-gnu-emacs@m.gmane.org; Wed, 04 Dec 2019 11:10:46 -0500 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:56980) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1icWxc-0002yk-Ml for bug-gnu-emacs@gnu.org; Wed, 04 Dec 2019 10:53:05 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1icWxa-00039d-VR for bug-gnu-emacs@gnu.org; Wed, 04 Dec 2019 10:53:04 -0500 Original-Received: from debbugs.gnu.org ([209.51.188.43]:36536) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1icWxZ-000397-Qx for bug-gnu-emacs@gnu.org; Wed, 04 Dec 2019 10:53:02 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1icWxZ-0004hz-OB for bug-gnu-emacs@gnu.org; Wed, 04 Dec 2019 10:53:01 -0500 X-Loop: help-debbugs@gnu.org Resent-From: Eli Zaretskii Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Wed, 04 Dec 2019 15:53:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 38485 X-GNU-PR-Package: emacs Original-Received: via spool by 38485-submit@debbugs.gnu.org id=B38485.157547474818060 (code B ref 38485); Wed, 04 Dec 2019 15:53:01 +0000 Original-Received: (at 38485) by debbugs.gnu.org; 4 Dec 2019 15:52:28 +0000 Original-Received: from localhost ([127.0.0.1]:42509 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1icWx1-0004hE-Jc for submit@debbugs.gnu.org; Wed, 04 Dec 2019 10:52:27 -0500 Original-Received: from eggs.gnu.org ([209.51.188.92]:47837) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1icWwz-0004h0-MT for 38485@debbugs.gnu.org; Wed, 04 Dec 2019 10:52:26 -0500 Original-Received: from fencepost.gnu.org ([2001:470:142:3::e]:49736) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1icWwu-0002t5-Ec; Wed, 04 Dec 2019 10:52:20 -0500 Original-Received: from [176.228.60.248] (port=2571 helo=home-c4e4a596f7) by fencepost.gnu.org with esmtpsa (TLS1.2:RSA_AES_256_CBC_SHA1:256) (Exim 4.82) (envelope-from ) id 1icWwt-0002lU-1T; Wed, 04 Dec 2019 10:52:20 -0500 In-reply-to: <3183ba6c-6aea-fa25-bb32-7e5ff7c04ad6@gmail.com> (message from =?UTF-8?Q?Cl=C3=A9ment?= Pit-Claudel on Tue, 3 Dec 2019 23:22:35 -0500) X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 209.51.188.43 X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Original-Sender: "bug-gnu-emacs" Xref: news.gmane.org gmane.emacs.bugs:172837 Archived-At: > From: Clément Pit-Claudel > Date: Tue, 3 Dec 2019 23:22:35 -0500 > > Interestingly, both of these cases are handled quite nicely in emacs -nw, because there the display is purely grid-like. FTR, I'd like to clarify that Emacs doesn't "handle" the -nw case in any way, it's taken care for us of by the terminal itself. Assuming that the terminal has the same notion of character width as Emacs does, that is; if they use different tables, the characters will not align. > For my use case, it would be enough to have this available as a minor mode, but Yuan Fu mentioned the following on emacs-devel: "I’d like to see it as a face attribute instead of a mode. (Because I want to align my org table). Maybe there could be a face attribute (:grid WIDTH) that instructs the display engine to pad each glyph to have width that is a multiple of WIDTH in pixel, and if WIDTH is t, default to “base character width”? I remembered that ‘window-width’ gives width in char widths and had a look at its source. It knows the character width from FRAME_COLUMN_WIDTH; the comment says the value currently equals to the average width of the default font of the frame. I think this value can be used as the “base character width”." I don't think I understand the rationale for using a face. It sounds like a subset of the general case, and why would someone want this alignment only for one special face? Using a face also means that the same characters from a larger font will not be aligned. > Now that I think of it, though, I could see the use for a text property. For example, prettify-symbols-mode could have an option to make each n-characters prettification n-characters wide, so that composing ~~> into ⟿ would produce a wide arrow occupying the exact same amount of space as the original uncomposed characters. So what kind of text property would that be, and where and how will it come into play in the above scenario? Thanks.