GNU bug report logs - #63544
28.3; extra width not renderes correctly in TUI when making a character wider

Please note: This is a static page, with minimal formatting, updated once a day.
Click here to see this page with the latest information and nicer formatting.

Package: emacs; Reported by: Adam Ibrahim <ibrahimadam193@HIDDEN>; Keywords: notabug; dated Wed, 17 May 2023 02:05:01 UTC; Maintainer for emacs is bug-gnu-emacs@HIDDEN.
Added tag(s) notabug. Request was from Eli Zaretskii <eliz@HIDDEN> to control <at> debbugs.gnu.org. Full text available.

Message received at 63544 <at> debbugs.gnu.org:


Received: (at 63544) by debbugs.gnu.org; 17 May 2023 13:25:23 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Wed May 17 09:25:23 2023
Received: from localhost ([127.0.0.1]:49281 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1pzH9e-0006Vb-W5
	for submit <at> debbugs.gnu.org; Wed, 17 May 2023 09:25:23 -0400
Received: from eggs.gnu.org ([209.51.188.92]:57658)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <eliz@HIDDEN>)
 id 1pzH9d-0006VK-6S; Wed, 17 May 2023 09:25:21 -0400
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 1pzH9X-0002Zw-Su; Wed, 17 May 2023 09:25:15 -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=vqO75dRvLPueylOw3rnc7Tf7JLiTIzRv6PPxFm1VuwY=; b=TWZcXrFSJbVDo7CBJ8RO
 eftUQwynFw941mnYggzH0lZDeraPopsNyvnmPAyZcHxVqLT9yJQDtmYeBg+TQiGtxJbG+NCp1qwMf
 lPPM9Gghagsnktxk8rr6OgOu7FZof/qajArp5rflAnDX6DxnOL3tpHtN5HtoHjgI8t7NupPogZ/wv
 DMxp1i+xm2hfOyEF2IAEKabWvLQxEhyA5Ggd0cebabhNQFpcqRkMMbgBXAqvvKrMrIWoM4DjXrO0j
 62wsyUGLLl/4ysj4knWY1y9CtIl/WnpXdCudnX60iSg+FuDFLdod+filJ6B1dRLsAcwhbqqb5lI/q
 ENYIDkrVFrlAKQ==;
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 <eliz@HIDDEN>)
 id 1pzH9Q-0006mN-CO; Wed, 17 May 2023 09:25:15 -0400
Date: Wed, 17 May 2023 16:25:17 +0300
Message-Id: <83ednfxf7m.fsf@HIDDEN>
From: Eli Zaretskii <eliz@HIDDEN>
To: Adam Ibrahim <ibrahimadam193@HIDDEN>
In-Reply-To: <CAHdC_i+USpAEQPF9LG63JiqWK9iWs0pW=XsW3aBZW76ZnbYNvA@HIDDEN>
 (message from Adam Ibrahim on Tue, 16 May 2023 15:34:38 -0400)
Subject: Re: bug#63544: 28.3;
 extra width not renderes correctly in TUI when making a character
 wider
References: <CAHdC_i+USpAEQPF9LG63JiqWK9iWs0pW=XsW3aBZW76ZnbYNvA@HIDDEN>
MIME-version: 1.0
Content-type: text/plain; charset=utf-8
Content-Transfer-Encoding: 8bit
X-Spam-Score: -2.3 (--)
X-Debbugs-Envelope-To: 63544
Cc: 63544 <at> debbugs.gnu.org
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 (---)

tags 63544 notabug
thanks

> From: Adam Ibrahim <ibrahimadam193@HIDDEN>
> Date: Tue, 16 May 2023 15:34:38 -0400
> 
> When I make a character wider by changing the char width table, it isn't
> sometimes with shows and sometimes it doesn't.
> 
> 1. Start up emacs with this command.
> 
> emacs -Q --eval '(progn (set-char-table-range char-width-table #x221e 2) (set-char-table-range
> char-width-table #x2014 2))'
> 
> 2. Type "—a" into the scratch buffer. The em dash should be correctly rendered two cells wide, and the
> a shouldn't overlap with the em dash.
> 3. `M-x redraw-screen`. The em dash should now overlap the a.

(I guess you mean "M-x redraw-display".  There's no redraw-screen
command in Emacs.)

I'm guessing you did the above in order to cause the em-dash character
display as two character cells instead of just one.  But that will
only work if, when the em-dash character is written to the terminal,
its glyph indeed takes two character cells, and the terminal tells the
driver that the "virtual write cursor" was moved by two character
cells.  Emacs expects double-width characters to produce that effect,
and evidently in your case this character doesn't.

The upshot is that we cannot support artificially "widening"
characters which don't behave like double-width characters from the
POV of the terminal emulator.  Just using a font where the character's
glyph is wide is not enough; you need the terminal emulator to
understand that this is the case with these characters, and behave
accordingly.

The above "sometimes works" because Emacs doesn't always write the
entire screen line of the characters.  It tries very hard to minimize
the writes to the glass.  So when you type the initial '—' character,
Emacs writes only it, and then moves the display cursor to where it
thinks it should be -- which is column 2 (zero-based).  Then, when you
type 'a', Emacs inserts just the glyph for 'a', it doesn't redraw the
first '—' character.

By contrast, when you invoke redraw-display, Emacs redraws the entire
line, expecting the 'a' character to be written by the terminal
emulator starting at column 2, not column 1.  It expects the terminal
emulator to make sure this is what happens when Emacs writes the
string "—a" to the terminal.  But in your case, it doesn't: the 'a'
character starts at column 1, so it overlaps with '—'.

IOW, Emacs assumes that writing a single character '—' occupies 2
columns no matter whether there are or aren't characters after '—'.
And that requires the terminal emulator to play along, when you use
Iosevka (and other similar fonts).

This is not a bug.  I don't see how Emacs could do anything here to
fix the terminal emulator, without causing serious degradation in
redisplay performance.

Sorry.




Information forwarded to bug-gnu-emacs@HIDDEN:
bug#63544; Package emacs. Full text available.

Message received at submit <at> debbugs.gnu.org:


Received: (at submit) by debbugs.gnu.org; 17 May 2023 02:04:36 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Tue May 16 22:04:36 2023
Received: from localhost ([127.0.0.1]:48356 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1pz6Wn-0000aZ-KJ
	for submit <at> debbugs.gnu.org; Tue, 16 May 2023 22:04:36 -0400
Received: from lists.gnu.org ([209.51.188.17]:41948)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <ibrahimadam193@HIDDEN>) id 1pz0Rm-00063l-6l
 for submit <at> debbugs.gnu.org; Tue, 16 May 2023 15:35:01 -0400
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 <ibrahimadam193@HIDDEN>)
 id 1pz0Rl-0004nn-Tn
 for bug-gnu-emacs@HIDDEN; Tue, 16 May 2023 15:34:57 -0400
Received: from mail-ej1-x62c.google.com ([2a00:1450:4864:20::62c])
 by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128)
 (Exim 4.90_1) (envelope-from <ibrahimadam193@HIDDEN>)
 id 1pz0Rk-0000pt-EC
 for bug-gnu-emacs@HIDDEN; Tue, 16 May 2023 15:34:57 -0400
Received: by mail-ej1-x62c.google.com with SMTP id
 a640c23a62f3a-96622bca286so2370464466b.1
 for <bug-gnu-emacs@HIDDEN>; Tue, 16 May 2023 12:34:55 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
 d=gmail.com; s=20221208; t=1684265694; x=1686857694;
 h=to:subject:message-id:date:from:mime-version:from:to:cc:subject
 :date:message-id:reply-to;
 bh=PcIKB2o3JXe0sHxZ5e79V8oaD5DzqafifjBh2gd1BjQ=;
 b=bshrzgzZACabL4Hg0hUrnfxxGHxSn5ibHYKN8+aUgMFMcdk1TNDHxFarVHz36dMKY0
 /m5ODLTa5RHd6JuiVTRMehh7DlKM9KpnpwEzBz4TavC6NuJzJ/ubCXmSTLZOxjLmpc4P
 4313pl+ykknSuw9XX4kAF+yUEgA8gah2wA87Ja/+mJJeGkRT7J4EAH6uYwZ5p+dYB79z
 but6RIKmaPw6ET4Z5SdI1gfbDPg6lTdpfjbo5JTUwkPSq6wqr/HsrXtFZvVDXBuctSHJ
 GFYDIz8KETT1tKgAIEt0IDIJdx17VhJqGU1Y3W36oR1Yk30YUQPuwAHm6P2vQNaNb4HT
 XMtg==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
 d=1e100.net; s=20221208; t=1684265694; x=1686857694;
 h=to:subject:message-id:date:from:mime-version:x-gm-message-state
 :from:to:cc:subject:date:message-id:reply-to;
 bh=PcIKB2o3JXe0sHxZ5e79V8oaD5DzqafifjBh2gd1BjQ=;
 b=MlCU4xZ8LpNH5JaLYWq8ptPcUzKuOXU1OR2Ox+oNldC0r6qUd72CXoFymrYTY0467K
 JDvRwnvTURatApx7gVFYZ0CnwSJPouu7aQEQ/cOAj1kreo84WLTOHLCwqdiDQ38moO4X
 8na9vXpc6jSNfzZMbq8PQdBxPg4NiFMUB+qKAV9xraDjFVmK/ETlYPSfDilXn2yXZq2Y
 8v5dEhPJ418tVPOmHEFGyNwproNbEGzEcxKOkuEUaIQfWAXsn8PQZARlpsdDXoE8YTMO
 4LM9LXQRgfr2oCXLWxiolKNlgrTcnLLgqUj62nlF43arEVQVgZlviVneqrLxb8vL3jq1
 OmKQ==
X-Gm-Message-State: AC+VfDwSU3Mf3UfRV1cS7C7v4w5Mts18Do2zUkwou4m/Fbc/Da3MTVig
 uFhNESAyCzG1whApBPvlNUdI1CcJWNV3Ar3t27mGdsmd
X-Google-Smtp-Source: ACHHUZ7dfwDeT+n92GjlIRXtJk/Nt7OIO2H9LB/UoJZHSSlF2W5vK88A5Ae7gJk4nUdeCV3kpf7rjV8SOPPuZMjzLck=
X-Received: by 2002:a17:907:7296:b0:96a:580e:bf0f with SMTP id
 dt22-20020a170907729600b0096a580ebf0fmr16483205ejc.14.1684265693775; Tue, 16
 May 2023 12:34:53 -0700 (PDT)
MIME-Version: 1.0
From: Adam Ibrahim <ibrahimadam193@HIDDEN>
Date: Tue, 16 May 2023 15:34:38 -0400
Message-ID: <CAHdC_i+USpAEQPF9LG63JiqWK9iWs0pW=XsW3aBZW76ZnbYNvA@HIDDEN>
Subject: 28.3; extra width not renderes correctly in TUI when making a
 character wider
To: bug-gnu-emacs@HIDDEN
Content-Type: multipart/alternative; boundary="00000000000062892705fbd4aa65"
Received-SPF: pass client-ip=2a00:1450:4864:20::62c;
 envelope-from=ibrahimadam193@HIDDEN; helo=mail-ej1-x62c.google.com
X-Spam_score_int: -18
X-Spam_score: -1.9
X-Spam_bar: -
X-Spam_report: (-1.9 / 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,
 FREEMAIL_ENVFROM_END_DIGIT=0.25, FREEMAIL_FROM=0.001, HTML_MESSAGE=0.001,
 RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001,
 T_SCC_BODY_TEXT_LINE=-0.01 autolearn=ham autolearn_force=no
X-Spam_action: no action
X-Spam-Score: -1.1 (-)
X-Debbugs-Envelope-To: submit
X-Mailman-Approved-At: Tue, 16 May 2023 22:04:31 -0400
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: -2.1 (--)

--00000000000062892705fbd4aa65
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable

When I make a character wider by changing the char width table, it isn't
sometimes with shows and sometimes it doesn't.

1. Start up emacs with this command.

emacs -Q --eval '(progn (set-char-table-range char-width-table #x221e 2)
(set-char-table-range char-width-table #x2014 2))'

2. Type "=E2=80=94a" into the scratch buffer. The em dash should be correct=
ly
rendered two cells wide, and the a shouldn't overlap with the em dash.
3. `M-x redraw-screen`. The em dash should now overlap the a.

consistently works with:

- Termux, iosevka
- xfce4-terminal, iosevka and source code pro
- Kitty, iosevka

--00000000000062892705fbd4aa65
Content-Type: text/html; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable

<div dir=3D"auto"><br><br>When I make a character wider by changing the cha=
r width table, it isn&#39;t<br>sometimes with shows and sometimes it doesn&=
#39;t.<br><br>1. Start up emacs with this command.<br><br>	emacs -Q --eval =
&#39;(progn (set-char-table-range char-width-table #x221e 2) (set-char-tabl=
e-range char-width-table #x2014 2))&#39;<br><br>2. Type &quot;=E2=80=94a&qu=
ot; into the scratch buffer. The em dash should be correctly rendered two c=
ells wide, and the a shouldn&#39;t overlap with the em dash.<br>3. `M-x red=
raw-screen`. The em dash should now overlap the a.<br><br>consistently work=
s with:<br><br>- Termux, iosevka<br>- xfce4-terminal, iosevka and source co=
de pro<br>- Kitty, iosevka<br>=C2=A0</div>

--00000000000062892705fbd4aa65--




Acknowledgement sent to Adam Ibrahim <ibrahimadam193@HIDDEN>:
New bug report received and forwarded. Copy sent to bug-gnu-emacs@HIDDEN. Full text available.
Report forwarded to bug-gnu-emacs@HIDDEN:
bug#63544; Package emacs. Full text available.
Please note: This is a static page, with minimal formatting, updated once a day.
Click here to see this page with the latest information and nicer formatting.
Last modified: Wed, 17 May 2023 13:30:02 UTC

GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997 nCipher Corporation Ltd, 1994-97 Ian Jackson.