From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.ciao.gmane.io!not-for-mail From: Pip Cet Newsgroups: gmane.emacs.bugs Subject: bug#41645: 27.0.91; Combining Grapheme Joiner (#x34f) gui artifacts Date: Wed, 03 Jun 2020 14:58:07 +0000 Message-ID: <87d06g6vsw.fsf@gmail.com> References: <83zh9merd4.fsf@gnu.org> <83wo4qepab.fsf@gnu.org> <83lfl6eiod.fsf@gnu.org> <83zh9lcuyg.fsf@gnu.org> <87o8q1xohw.fsf@gmail.com> <83d06gcjtp.fsf@gnu.org> Mime-Version: 1.0 Content-Type: text/plain Injection-Info: ciao.gmane.io; posting-host="ciao.gmane.io:159.69.161.202"; logging-data="99655"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Gnus/5.13 (Gnus v5.13) Cc: dfussner@googlemail.com, 41645@debbugs.gnu.org To: Eli Zaretskii Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Wed Jun 03 17:02:17 2020 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 1jgUuF-000PTs-KF for geb-bug-gnu-emacs@m.gmane-mx.org; Wed, 03 Jun 2020 17:02:16 +0200 Original-Received: from localhost ([::1]:49918 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jgUu8-00081o-14 for geb-bug-gnu-emacs@m.gmane-mx.org; Wed, 03 Jun 2020 11:02:08 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:36568) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1jgUr9-00032T-CW for bug-gnu-emacs@gnu.org; Wed, 03 Jun 2020 10:59:03 -0400 Original-Received: from debbugs.gnu.org ([209.51.188.43]:32819) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1jgUr9-0001Mh-0X for bug-gnu-emacs@gnu.org; Wed, 03 Jun 2020 10:59:03 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1jgUr9-0008ML-0l for bug-gnu-emacs@gnu.org; Wed, 03 Jun 2020 10:59:03 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Pip Cet Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Wed, 03 Jun 2020 14:59:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 41645 X-GNU-PR-Package: emacs Original-Received: via spool by 41645-submit@debbugs.gnu.org id=B41645.159119631232075 (code B ref 41645); Wed, 03 Jun 2020 14:59:02 +0000 Original-Received: (at 41645) by debbugs.gnu.org; 3 Jun 2020 14:58:32 +0000 Original-Received: from localhost ([127.0.0.1]:44360 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1jgUqR-0008Kx-Dd for submit@debbugs.gnu.org; Wed, 03 Jun 2020 10:58:32 -0400 Original-Received: from mail-wm1-f52.google.com ([209.85.128.52]:52785) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1jgUqP-0008Kk-Mc for 41645@debbugs.gnu.org; Wed, 03 Jun 2020 10:58:18 -0400 Original-Received: by mail-wm1-f52.google.com with SMTP id r9so2243988wmh.2 for <41645@debbugs.gnu.org>; Wed, 03 Jun 2020 07:58:17 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:references:date:in-reply-to:message-id :user-agent:mime-version; bh=LOmTKnQww54QziAW4JxbjM/YCevP6UwGqKysvZdVY2k=; b=s/enPla07xQEsXr0bljraPr5u7HQG9ulK6KRmyYEwA8sRANZp4R8MtJpd+rnfUaIZM ePaLqlM+E4Fg3cEbBgBPItJc6VgCzpuDvmq42p/5ga/Bn+kuZJ3h36RlQclMNoV+M70f h96S0cKWcmNy8yzfqPYaiygT02Q4GyNFY0tS5MTyLXiY/Lhjize3f6stsGirH7tM0IWY 4Nd5oHmXzBgk5RmvbGfKSBXNYICPyglFZaLFAi9hm0uTULKxQqCQzNDlF+TQUcL4Zi+i VmpclVJZlz95ph1X4KTYmj3Qddc5TCAEtGvY4QoGRSQPHt4DSGXzxFfzt6ehg4RFzR3D RRXA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:references:date:in-reply-to :message-id:user-agent:mime-version; bh=LOmTKnQww54QziAW4JxbjM/YCevP6UwGqKysvZdVY2k=; b=SSnDJrUyayBbleyq2I6pVZ514YEpZPlL5bMGFHzOaste1xMFT9vsK36xKm3mlvb4bC wjVgvWIAWRg0BVxFJibacm71Qw6iZKrnTrvxHt1uUvXxnURkVMVB2RpuKNxgBxvEAIuz /xYFmgMxDlekMWS74UHb9NZXQCvzhyR1+BnW9Oth3qhnzPGlYeETDf2Dg+FF3ZBagJXV JJTB/vzCK2xAG6H3LqwFo/dqFLWMYLnBSk+bJQ0wNOtfBIXdmdVu6vOvyR1vQGUA+rVM uA5KYQhOGxCxCOSb+2UZw4Ovc6F6Trv6GOqX0vKP7z0bjGWKW0+7JTPcYOu53rbV20PX ktpw== X-Gm-Message-State: AOAM531KWBsGXtAHRtLnb8ciVpvqAfsozLFlR9/a1LBBkbRHfJBUcg9d Ou0BrJ4eJKC2fHpoWupfueqpnIAvVB0= X-Google-Smtp-Source: ABdhPJz+LxJQr5ukePkq6o4SXoLSdM1uCF+lewjWvIcp5QGZPtgqoXbQQ6D1D/TmQCGkzz8qMYnSLg== X-Received: by 2002:a05:600c:34e:: with SMTP id u14mr9172094wmd.16.1591196291264; Wed, 03 Jun 2020 07:58:11 -0700 (PDT) Original-Received: from chametz ([185.220.102.6]) by smtp.gmail.com with ESMTPSA id b81sm3832971wmc.5.2020.06.03.07.58.09 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 03 Jun 2020 07:58:10 -0700 (PDT) In-Reply-To: <83d06gcjtp.fsf@gnu.org> (Eli Zaretskii's message of "Wed, 03 Jun 2020 17:20:18 +0300") 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" Xref: news.gmane.io gmane.emacs.bugs:181461 Archived-At: Eli Zaretskii writes: >> From: Pip Cet >> Cc: dfussner@googlemail.com, 41645@debbugs.gnu.org >> Date: Tue, 02 Jun 2020 19:21:31 +0000 >> >> >> xdisp.c: >> >> 30008 if (get_char_glyph_code (it->char_to_display, font, >> >> &char2b)) >> >> 30009 { >> >> 30010 pcm = get_per_char_metric (font, &char2b); >> >> 30011 if (pcm->width == 0 >> >> 30012 && pcm->rbearing == 0 && pcm->lbearing == 0) >> >> 30013 pcm = NULL; >> >> 30014 } >> >> >> > >> > ...with this. I think you are right, and we should do the same with >> > zero-width LGLYPH_STRING, forcing it->glyph_not_available_p to >> > non-zero, and then doing something like this in >> > fill_gstring_glyph_string: >> > >> > if (s->font == NULL || glyph_not_available_p) >> > { >> > s->font_not_found_p = true; >> > s->font = FRAME_FONT (s->f); >> > } >> > >> > similar to what fill_glyph_string does. WDYT? >> >> I agree; the more I think about it, the more dangerous zero-sized >> characters seem to me. >> >> And almost all of my concerns apply to characters with zero x advance, >> no matter whether they have lbearing or rbearing > 0. > > AFAIU, the advance metric is what we call "pixel width", and if so, > the above snippet from xdisp.c already tests it. Right? Some code after it does, yes. >> Maybe, for master, we should reject those as well? I was going to say >> "or force their width to be at least a single pixel", but I'm not even >> sure that's sufficient on hidpi screens... >> >> So, in summary, I'd like to do the following: >> >> 1. abort if we ever find ourselves drawing a zero-width cursor >> 2. reject lgstrings of zero width >> 3. reject all glyphs of zero width outside of compositions >> 4. allow users to specify a minimum width, perhaps relative to the font >> size, so they can always see their cursor >> >> ...which would be quite a different patch. > > I'm not sure I follow. What do you mean by "reject"? I thought the > code which ignores the metric and sets the font_not_found_p flag when > we get a zero-width glyph is a kind of "rejection". I mean "treat the glyph as non-existent". Currently, for (3), glyphs with lbearing but no pixel width are treated as valid and expanded to cover a single pixel, which is all but invisible on my screen. > I like the idea > of doing that in the case of compositions because that is consistent > with what we do when we extract the metrics directly from the font. I do too. > Are you saying that what we do with simple characters in this case is > not good enough? I'm saying it's not good enough for non-spacing characters that actually do print something: they're displayed as single-pixel-wide glyphs, which I think is insufficient to let users be aware of them. > If you disable auto-composition-mode, and use the > fonts which shows CGJ as zero-width glyph, do you still see display > artifacts? No. > If not, what do you see and why is this kind of > 'rejection" not enough? CGJ is displayed as a black box as wide as a space, which is perfectly fine. It's U+301 that's not.