bug-gnu-emacs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

bug#41645: 27.0.91; Combining Grapheme Joiner (#x34f) gui artifacts


From: Eli Zaretskii
Subject: bug#41645: 27.0.91; Combining Grapheme Joiner (#x34f) gui artifacts
Date: Wed, 03 Jun 2020 17:20:18 +0300

> From: Pip Cet <pipcet@gmail.com>
> 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?

> 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 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.

Are you saying that what we do with simple characters in this case is
not good enough?  If you disable auto-composition-mode, and use the
fonts which shows CGJ as zero-width glyph, do you still see display
artifacts?  If not, what do you see and why is this kind of
'rejection" not enough?





reply via email to

[Prev in Thread] Current Thread [Next in Thread]