unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
From: Eli Zaretskii <eliz@gnu.org>
To: Pip Cet <pipcet@gmail.com>
Cc: dfussner@googlemail.com, 41645@debbugs.gnu.org
Subject: bug#41645: 27.0.91; Combining Grapheme Joiner (#x34f) gui artifacts
Date: Tue, 02 Jun 2020 19:07:35 +0300	[thread overview]
Message-ID: <83zh9lcuyg.fsf@gnu.org> (raw)
In-Reply-To: <CAOqdjBfjJ8rgonJ6E2Q1y80=KDj8+-su6PP-3L-gqfjNZ9UmEw@mail.gmail.com> (message from Pip Cet on Mon, 1 Jun 2020 19:48:15 +0000)

> From: Pip Cet <pipcet@gmail.com>
> Date: Mon, 1 Jun 2020 19:48:15 +0000
> Cc: dfussner@googlemail.com, 41645@debbugs.gnu.org
> 
> >   (aref composition-function-table #x34f)
> >    => (["\\c.\\c^+" 1 compose-gstring-for-graphic]
> >        [nil 0 compose-gstring-for-graphic])
> 
> > So CGJ is supposed to be composed with the previous character,
> > similarly to diacritics.
> 
> (BTW, isn't that regexp wrong? a base character can be followed by two
> diacritics, then a CGJ, then another diacritic...)

No, I don't think the regexp is wrong.  Every character whose Unicode
general-category property is Mn is given the '^' ("combining")
category, see characters.el.  The CGJ is one of them, but all the
accents and diacritics are also of that class.  So the above matches
any sequence of Mn characters in any order and permutation -- which is
of course more than is needed, but we rely on the shaper to combine
only those that should be.

For example, if I type the following 4 characters:

  LATIN SMALL LETTER U (U+0075) + COMBINING GRAVE ACCENT (U+0300) +
  CGJ (U+034F) + COMBINING DIAERESIS (U+0308)

I see the composition working correctly, provided that I use a font
that supports all the 4 codepoints.

> > And another question: in the cases where you see artifacts, does the
> > call to font-shape-gstring inside compose-gstring-for-graphic return
> > nil or non-nil?
> 
> Neither, it's never reached. The first rule fails because font_range
> restricts the composition range to a single character, so the second
> rule applies.

OK, that's the crucial fact: it means that the font used for CGJ is
not the same one as used for the surrounding text.  This is a
situation I never saw on my systems.  In addition, the font used for
the CGJ has a zero-width glyph for it, which is another thing I never
saw (I meanwhile tried almost 20 different fonts supporting the CGJ,
and all of them either produce a 1-pixel thin space or the funny box
with a circle inside).

So I think now it's clear what is going when this particular font is
present, and we are left...

> I think we're just failing to deal with a zero-width autocomposition
> glyph, because we're dealing fine with the same glyph when
> autocomposition is off.
> 
> 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?





  parent reply	other threads:[~2020-06-02 16:07 UTC|newest]

Thread overview: 37+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-06-01 13:45 bug#41645: 27.0.91; Combining Grapheme Joiner (#x34f) gui artifacts David Fussner via Bug reports for GNU Emacs, the Swiss army knife of text editors
2020-06-01 15:29 ` Eli Zaretskii
2020-06-01 15:50   ` Pip Cet
2020-06-01 16:06     ` David Fussner via Bug reports for GNU Emacs, the Swiss army knife of text editors
2020-06-01 16:36       ` Eli Zaretskii
2020-06-01 17:44         ` David Fussner via Bug reports for GNU Emacs, the Swiss army knife of text editors
2020-06-01 18:27       ` Pip Cet
2020-06-01 16:14     ` Eli Zaretskii
2020-06-01 18:09       ` Pip Cet
2020-06-01 18:37         ` Eli Zaretskii
2020-06-01 19:35           ` Eli Zaretskii
2020-06-01 20:15             ` Pip Cet
2020-06-01 19:48           ` Pip Cet
2020-06-01 22:37             ` Pip Cet
2020-06-02 13:45               ` David Fussner via Bug reports for GNU Emacs, the Swiss army knife of text editors
2020-06-02 13:57                 ` David Fussner via Bug reports for GNU Emacs, the Swiss army knife of text editors
2020-06-02 14:06                   ` Pip Cet
2020-06-02 14:32                     ` David Fussner via Bug reports for GNU Emacs, the Swiss army knife of text editors
2020-06-02 14:35                 ` Pip Cet
2020-06-02 14:39                   ` David Fussner via Bug reports for GNU Emacs, the Swiss army knife of text editors
2020-06-02 15:51                 ` Eli Zaretskii
2020-06-02 15:59                   ` David Fussner via Bug reports for GNU Emacs, the Swiss army knife of text editors
2020-06-02 16:07             ` Eli Zaretskii [this message]
2020-06-02 19:21               ` Pip Cet
2020-06-02 19:49                 ` David Fussner via Bug reports for GNU Emacs, the Swiss army knife of text editors
2020-06-03 14:20                 ` Eli Zaretskii
2020-06-03 14:58                   ` Pip Cet
2020-06-03 15:58                     ` Eli Zaretskii
2020-06-03 20:23                       ` Pip Cet
2020-06-04  2:36                         ` Eli Zaretskii
2020-06-04  6:58                           ` Pip Cet
2020-06-04 13:31                             ` Eli Zaretskii
     [not found]                               ` <874krq4fd8.fsf@gmail.com>
2020-06-05  7:45                                 ` Eli Zaretskii
2020-06-05  8:31                                   ` Pip Cet
2020-06-05 15:54                                     ` David Fussner via Bug reports for GNU Emacs, the Swiss army knife of text editors
2020-06-05 17:28                                       ` Eli Zaretskii
2020-06-02 15:52         ` Eli Zaretskii

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.gnu.org/software/emacs/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=83zh9lcuyg.fsf@gnu.org \
    --to=eliz@gnu.org \
    --cc=41645@debbugs.gnu.org \
    --cc=dfussner@googlemail.com \
    --cc=pipcet@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).