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

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

bug#39133: 28.0.50; Emacs slowdown on special char


From: Eli Zaretskii
Subject: bug#39133: 28.0.50; Emacs slowdown on special char
Date: Wed, 15 Jan 2020 18:19:28 +0200

> Date: Wed, 15 Jan 2020 13:26:11 +0900
> From: YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
> Cc: Eli Zaretskii <eliz@gnu.org>,
>       Evgeny Zajcev <lg.zevlg@gmail.com>,
>       39133@debbugs.gnu.org, handa@gnu.org
> 
> +  if (code != FONT_INVALID_CODE)
> +    {
> +      struct font_metrics metrics;
> +
> +      LGLYPH_SET_CODE (glyph, code);
> +      font->driver->text_extents (font, &code, 1, &metrics);
> +      LGLYPH_SET_LBEARING (glyph, metrics.lbearing);
> +      LGLYPH_SET_RBEARING (glyph, metrics.rbearing);
> +      LGLYPH_SET_WIDTH (glyph, metrics.width);
> +      LGLYPH_SET_ASCENT (glyph, metrics.ascent);
> +      LGLYPH_SET_DESCENT (glyph, metrics.descent);
> +    }
>  }
>  
>  
> But I'm not sure if it is ok to leave the code and metrics-related
> fields nil when encode_char returns FONT_INVALID_CODE.  Handa-san?

We could do in the 'else' branch the same we do in the single caller
of this function, fill_gstring_body, when we don't call
font_fill_lglyph_metrics:

      if (FONT_OBJECT_P (font_object))
        {
          font_fill_lglyph_metrics (g, font_object);
        }
      else
        {
          int width = XFIXNAT (CHAR_TABLE_REF (Vchar_width_table, c));

          LGLYPH_SET_CODE (g, c);
          LGLYPH_SET_LBEARING (g, 0);
          LGLYPH_SET_RBEARING (g, width);
          LGLYPH_SET_WIDTH (g, width);
          LGLYPH_SET_ASCENT (g, 1);
          LGLYPH_SET_DESCENT (g, 0);
        }





reply via email to

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