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

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

Re: [emacs-unicode-2] Segmentation fault 0x081b3df2 in xftfont_draw


From: Kenichi Handa
Subject: Re: [emacs-unicode-2] Segmentation fault 0x081b3df2 in xftfont_draw
Date: Fri, 18 May 2007 10:40:30 +0900
User-agent: SEMI/1.14.3 (Ushinoya) FLIM/1.14.2 (Yagi-Nishiguchi) APEL/10.2 Emacs/23.0.0 (i686-pc-linux-gnu) MULE/6.0 (HANACHIRUSATO)

In article <address@hidden>, Leo <address@hidden> writes:

> ----- Kenichi Handa (2007-04-17) wrote:-----
>>> > I found a suspicious code and just installed a patch.  Could
>>> > you please try with the latest source?  The page
>>> > www.6park.com has a character U+25CF (BLACK CIRCLE) near the
>>> > center of the top page.  I think the crash happened when you
>>> > put mouse-cursor on it, and the new code stops the crashing.
> >
>>> I can confirm the fix. I tried to trigger a crash but was not able to.
> >
> > Thank you for checking that.
> >
>>> > And, I think the frequency of flickering is also reduced.
> >
>>> Flickering is still a problem.
> >
> > Yes.  What I've done is just to reduce it.  I'm now working
> > on improving it.

> Any news on this?

I've been using the attached patch for a while.  It seems
that the flickering in M-x hanoi stopped.  But, the
flickering with w3m (while visiting www.6park.com) is still
there.  I was trying to find that reason, but I had to
switch to the other works.   For the moment, I don't have a
time to investigate this problem.

Anyway, could you try the patch too?

---
Kenichi Handa
address@hidden

*** xftfont.c   05 Apr 2007 11:03:59 +0900      1.1.2.17
--- xftfont.c   18 May 2007 10:27:25 +0900      
***************
*** 223,228 ****
--- 223,229 ----
    int spacing;
    char *name;
    int len;
+   XGlyphInfo extents;
  
    val = AREF (entity, FONT_EXTRA_INDEX);
    if (XTYPE (val) != Lisp_Misc
***************
*** 285,310 ****
    font->file_name = (char *) file;
    font->font.size = xftfont->max_advance_width;
    font->font.charset = font->encoding_charset = font->repertory_charset = -1;
-   font->ascent = xftfont->ascent;
-   font->descent = xftfont->descent;
-   font->font.height = xftfont->ascent + xftfont->descent;
  
    if (FcPatternGetInteger (xftfont->pattern, FC_SPACING, 0, &spacing)
        != FcResultMatch)
      spacing = FC_PROPORTIONAL;
    if (spacing != FC_PROPORTIONAL)
!     font->font.average_width = font->font.space_width
!       = xftfont->max_advance_width;
    else
      {
-       XGlyphInfo extents;
- 
-       if (! ascii_printable[0])
-       {
-         int i;
-         for (i = 0; i < 95; i++)
-           ascii_printable[i] = ' ' + i;
-       }
        XftTextExtents8 (display, xftfont, ascii_printable, 1, &extents);
        font->font.space_width = extents.xOff;
        if (font->font.space_width <= 0)
--- 286,309 ----
    font->file_name = (char *) file;
    font->font.size = xftfont->max_advance_width;
    font->font.charset = font->encoding_charset = font->repertory_charset = -1;
  
    if (FcPatternGetInteger (xftfont->pattern, FC_SPACING, 0, &spacing)
        != FcResultMatch)
      spacing = FC_PROPORTIONAL;
+   if (! ascii_printable[0])
+     {
+       int i;
+       for (i = 0; i < 95; i++)
+       ascii_printable[i] = ' ' + i;
+     }
    if (spacing != FC_PROPORTIONAL)
!     {
!       font->font.average_width = font->font.space_width
!       = xftfont->max_advance_width;
!       XftTextExtents8 (display, xftfont, ascii_printable + 1, 94, &extents);
!     }
    else
      {
        XftTextExtents8 (display, xftfont, ascii_printable, 1, &extents);
        font->font.space_width = extents.xOff;
        if (font->font.space_width <= 0)
***************
*** 315,320 ****
--- 314,327 ----
      }
    UNBLOCK_INPUT;
  
+   font->ascent = xftfont->ascent;
+   if (font->ascent < extents.y)
+     font->ascent = extents.y;
+   font->descent = xftfont->descent;
+   if (font->descent < extents.height - extents.y)
+     font->descent = extents.height - extents.y;
+   font->font.height = font->ascent + font->descent;
+ 
    /* Unfortunately Xft doesn't provide a way to get minimum char
       width.  So, we use space_width instead.  */
    font->min_width = font->font.space_width;
***************
*** 326,334 ****
  
    /* Setup pseudo XFontStruct */
    xfont->fid = xftfont_default_fid (f);
!   xfont->ascent = xftfont->ascent;
!   xfont->descent = xftfont->descent;
!   xfont->max_bounds.descent = xftfont->descent;
    xfont->max_bounds.width = xftfont->max_advance_width;
    xfont->min_bounds.width = font->font.space_width;
    font->font.font = xfont;
--- 333,341 ----
  
    /* Setup pseudo XFontStruct */
    xfont->fid = xftfont_default_fid (f);
!   xfont->ascent = font->ascent;
!   xfont->descent = font->descent;
!   xfont->max_bounds.descent = font->descent;
    xfont->max_bounds.width = xftfont->max_advance_width;
    xfont->min_bounds.width = font->font.space_width;
    font->font.font = xfont;




reply via email to

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