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.bugs Subject: bug#73752: 29.4; Ligatures are randomly rendered with extra spaces Date: Sun, 27 Oct 2024 19:43:55 +0200 Message-ID: <86cyjl8mqs.fsf@gnu.org> References: <86zfn9ycis.fsf@gnu.org> <86o735als7.fsf@gnu.org> <87o73534dn.fsf@gmail.com> <86h68x8nuz.fsf@gnu.org> <86ed418niu.fsf@gnu.org> <6566317e-03bb-4856-9cc8-5e90c2875e44@xlk.me> Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="20495"; mail-complaints-to="usenet@ciao.gmane.io" Cc: luangruo@yahoo.com, 73752@debbugs.gnu.org, visuweshm@gmail.com To: Yixuan Chen Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Sun Oct 27 18:44:42 2024 Return-path: Envelope-to: geb-bug-gnu-emacs@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 1t57Jh-0005EW-Gs for geb-bug-gnu-emacs@m.gmane-mx.org; Sun, 27 Oct 2024 18:44:41 +0100 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1t57JV-0008NF-Ej; Sun, 27 Oct 2024 13:44:29 -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 1t57JT-0008Mb-Az for bug-gnu-emacs@gnu.org; Sun, 27 Oct 2024 13:44:27 -0400 Original-Received: from debbugs.gnu.org ([2001:470:142:5::43]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1t57JT-0004bs-26 for bug-gnu-emacs@gnu.org; Sun, 27 Oct 2024 13:44:27 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=debbugs.gnu.org; s=debbugs-gnu-org; h=References:In-Reply-To:From:Date:To:Subject; bh=PIddTF4s/fmcAAtw+jeoqlfVZzzmy4TcAQU+XCRo/Ts=; b=BV8k+49/MJ3IU2dkSAaDG2yffQT7CJBZaTQfxwpLwnd5uT2HSUWdBZENh8UbeWiVbPpyOBkgN6kWgQQPIjT1A/M8nxYgvNjN4f8p/mz+jmVrCbg2hn7fzK6/ORcga0yRxWHfMpsmcFjNzCprnw6wpXWX/AQyTqEg4EBPXu/o2H0PuLD1Zh/Cm1pM3o0rw+XXSs8KwWuKK9/Fxjn6hstAt1m4sQzKLZyYS7XKrmJurQYMmaduKugdBRw3UbXNRKY1XiJbcZGE3SfMK1XSN5Res4YRh//bub7oBFzl32xfyLH1UrlpSwej5BL0bl1FmF4qXQfN5/jbx2Bpc0c2kv3vNg==; Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1t57K1-0001dd-Vk for bug-gnu-emacs@gnu.org; Sun, 27 Oct 2024 13:45:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Eli Zaretskii Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sun, 27 Oct 2024 17:45:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 73752 X-GNU-PR-Package: emacs Original-Received: via spool by 73752-submit@debbugs.gnu.org id=B73752.17300510816250 (code B ref 73752); Sun, 27 Oct 2024 17:45:01 +0000 Original-Received: (at 73752) by debbugs.gnu.org; 27 Oct 2024 17:44:41 +0000 Original-Received: from localhost ([127.0.0.1]:46128 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1t57Jh-0001ck-08 for submit@debbugs.gnu.org; Sun, 27 Oct 2024 13:44:41 -0400 Original-Received: from eggs.gnu.org ([209.51.188.92]:42536) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1t57Jf-0001cV-MX for 73752@debbugs.gnu.org; Sun, 27 Oct 2024 13:44:40 -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 1t57J0-0004Z6-Vf; Sun, 27 Oct 2024 13:43:59 -0400 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=PIddTF4s/fmcAAtw+jeoqlfVZzzmy4TcAQU+XCRo/Ts=; b=UyYfjvWQUKOA ew9J6fyrybf9T5lfj5PGDJ6Qz+jtllmROuI6CuSTy37XnYOvUvO+SSqTDO/ulrSTVcfrM6TYXD28h E23kppPMGDzcbdJZcy6h8qqjQa3FsxWWtYMmzPJwkVtQlMyBAK8f/5lo3KBxVkEBUvDH2QZ+aKZ3j MWMDE+c3mIU4goPwX7wi/cbGqeYBcPOBe2zwEpOMLtGax0A/gOOXJQ6gREGZBeY7WC2CFrOJE5o7S w2Zf0qiHt6OdP5pP8L/fMfgnhCBIPsnXCruBZvV3KwdM8mg9+dwkOIRxprMt4FEwoq4eEuekC55o+ tlVuISKHR6PLjTGLMBQLMQ==; In-Reply-To: <6566317e-03bb-4856-9cc8-5e90c2875e44@xlk.me> (message from Yixuan Chen on Sun, 27 Oct 2024 13:39:56 -0400) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list 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-mx.org@gnu.org Original-Sender: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Xref: news.gmane.io gmane.emacs.bugs:294379 Archived-At: > Date: Sun, 27 Oct 2024 13:39:56 -0400 > Cc: visuweshm@gmail.com, luangruo@yahoo.com, 73752@debbugs.gnu.org > From: Yixuan Chen > > On 10/27/24 13:27, Eli Zaretskii wrote: > > Or maybe I don't understand the original problem. The bug report says > > "extra spaces", but eacg font has its own metrics of the SPC glyph, so > > highlighting a line with a given face can affect the metrics of the > > whitespace. Why is this surprising? Or what did I miss? > > The problem is that the "space" being rendered is different in the > following two case: > > - if the default font is set to a specific combination of attributes > (say 16, bold, normal) from start, it renders all the characters with > one version of spacing. Let's call this version of spacing the > "expected" spacing, > - if the default font is some other combination of attributes (say 16, > regular, normal), and one line is set to the attribute of (16, bold, > normal). There is a **probability** that this line will render with a > different version of spacing than the "expected" spacing. In my setup, > this different spacing is extra wide. > > Ultimately, I believe the following should be true: if one line is > rendered with **the same font face attributes**, it should always be > rendered in **the same way**, regardless when, where, and how its > attributes are assigned. This is not the case for emacs right now, and > thus I consider it a bug. Sorry, I still don't understand. Your code does (highlight-lines-matching-regexp (cdr face) (car face)) This potentially shows each line in a different face, and thus can affect the metrics of the SPC character glyph which is what the indentation is made of. So why is this a problem, let alone a bug?