Re: Mode-line display bug in XFT_JHD_BRANCH

2006-04-25 Thread YAMAMOTO Mitsuharu
 On Mon, 17 Apr 2006 13:09:16 +0530, Baishampayan Ghose [EMAIL 
 PROTECTED] said:

 Hello, I am using the Emacs XFT_JHD_BRANCH and there is a weird
 mode-line display bug in it. When the file has variable width fonts
 like in LaTeX mode, the mode-line becomes garbled on scrolling. A
 screen shot [0] is attached.  I guess now that the XFT  Unicode
 branches have been merged, this critical bug will be fixed. I can
 help with testing the branch by doing daily builds, if it's being
 developed actively. Miles, what do you think about this?  Regards,
 BG

 [0] http://people.ubuntu-in.org/~ghoseb/emacs_xft_mode-line_bug.png

I tried to make a small patch for some problems that don't require too
many changes to fix (or workaround).  This is for XFT_JHD_BRANCH, not
for unicode-xft.  I don't have a plan to work for Xft support, but I
simply ported some results from my previous ATSUI support on Mac to
Xft.

 YAMAMOTO Mitsuharu
[EMAIL PROTECTED]


Index: src/xfaces.c
===
RCS file: /cvsroot/emacs/emacs/src/xfaces.c,v
retrieving revision 1.316.2.4
diff -c -r1.316.2.4 xfaces.c
*** src/xfaces.c12 Jan 2006 10:25:47 -  1.316.2.4
--- src/xfaces.c25 Apr 2006 07:37:07 -
***
*** 5282,5288 

XQueryColors (FRAME_X_DISPLAY (f), FRAME_X_DISPLAY_INFO (f)-cmap,
  colors, 2);
!   face-xft_fg.color.alpha = face-xft_fg.color.alpha = 0x;
face-xft_fg.color.red = colors[0].red;
face-xft_fg.color.green = colors[0].green;
face-xft_fg.color.blue = colors[0].blue;
--- 5282,5288 

XQueryColors (FRAME_X_DISPLAY (f), FRAME_X_DISPLAY_INFO (f)-cmap,
  colors, 2);
!   face-xft_fg.color.alpha = face-xft_bg.color.alpha = 0x;
face-xft_fg.color.red = colors[0].red;
face-xft_fg.color.green = colors[0].green;
face-xft_fg.color.blue = colors[0].blue;
***
*** 7243,7248 
--- 7243,7251 
  {
bcopy (base_face, face, sizeof *face);
face-gc = 0;
+ #ifdef HAVE_XFT
+   face-xft_draw = NULL;
+ #endif
  
/* Don't try to free the colors copied bitwise from BASE_FACE.  */
face-colors_copied_bitwise_p = 1;
Index: src/xterm.c
===
RCS file: /cvsroot/emacs/emacs/src/xterm.c,v
retrieving revision 1.861.2.4
diff -c -r1.861.2.4 xterm.c
*** src/xterm.c 12 Jan 2006 10:25:47 -  1.861.2.4
--- src/xterm.c 25 Apr 2006 07:37:08 -
***
*** 1202,1210 
  x_set_glyph_string_clipping (s)
   struct glyph_string *s;
  {
!   XRectangle r;
!   get_glyph_string_clip_rect (s, r);
!   XSetClipRectangles (s-display, s-gc, 0, 0, r, 1, Unsorted);
  }
  
  
--- 1202,1216 
  x_set_glyph_string_clipping (s)
   struct glyph_string *s;
  {
! #define MAX_CLIP_RECTS 2
!   XRectangle r[MAX_CLIP_RECTS];
!   int n;
! 
!   n = get_glyph_string_clip_rects (s, r, MAX_CLIP_RECTS);
!   XSetClipRectangles (s-display, s-gc, 0, 0, r, n, Unsorted);
! #ifdef HAVE_XFT
!   XftDrawSetClipRectangles (s-face-xft_draw, 0, 0, r, n);
! #endif
  }
  
  
***
*** 1382,1392 
   strlen (weight_name) +
   strlen (slant_name) + 
   5 +  /* pixel */
!  9 +  /* stars */
   14 + /* dashes */
   1);  /* null */
  xlfd = malloc (len);
! sprintf(xlfd, -%s-%s-%s-%s-*-*-%d-*-*-*-*-0-*-*,
foundry, family, weight_name, slant_name,
(int) (pixel + 0.5));
  return xlfd;
--- 1388,1398 
   strlen (weight_name) +
   strlen (slant_name) + 
   5 +  /* pixel */
!  6 + 1 + 8 + 1 +  /* stars, 0, iso10646, 1 */
   14 + /* dashes */
   1);  /* null */
  xlfd = malloc (len);
! sprintf(xlfd, -%s-%s-%s-%s-*-*-%d-*-*-*-*-0-iso10646-1,
foundry, family, weight_name, slant_name,
(int) (pixel + 0.5));
  return xlfd;
***
*** 1551,1589 
 use XDrawImageString when drawing the cursor so that there is
 no chance that characters under a box cursor are invisible.  */
  #ifdef HAVE_XFT
!   /* KOKO: Always clear background for now, there are some redraw problems
!  otherwise.  */
!   if (1 || ! (s-for_overlaps
!   || (s-background_filled_p  s-hl != DRAW_CURSOR)))
! XftDrawRect (s-face-xft_draw,
!  s-hl == DRAW_CURSOR ? s-face-xft_fg : 
s-face-xft_bg,
!  s-x,
!  s-y,
!  s-width + s-right_overhang,
!  s-height);
  
!   if (s-two_byte_p)
! {
!   XftChar16 ch[s-nchars];
!   int 

Mode-line display bug in XFT_JHD_BRANCH

2006-04-17 Thread Baishampayan Ghose
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

Hello,
I am using the Emacs XFT_JHD_BRANCH and there is a weird mode-line
display bug in it. When the file has variable width fonts like in LaTeX
mode, the mode-line becomes garbled on scrolling. A screen shot [0] is
attached.
I guess now that the XFT  Unicode branches have been merged, this
critical bug will be fixed. I can help with testing the branch by doing
daily builds, if it's being developed actively. Miles, what do you think
about this?
Regards,
BG

[0] http://people.ubuntu-in.org/~ghoseb/emacs_xft_mode-line_bug.png
- --
Baishampayan Ghose [EMAIL PROTECTED]
The GNU Project
http://www.gnu.org/

1024D/86361B74
BB2C E244 15AD 05C5 523A  90E7 4249 3494 8636 1B74

-BEGIN PGP SIGNATURE-
Version: GnuPG v1.4.2.2 (GNU/Linux)

iD8DBQFEQ0YkQkk0lIY2G3QRAkmRAJ481LzKWFBhPbnvQ/VO8cZhM5BLyACdElCx
8VgV5JDpNlVPaS6YKjoplJg=
=aU24
-END PGP SIGNATURE-


___
emacs-pretest-bug mailing list
emacs-pretest-bug@gnu.org
http://lists.gnu.org/mailman/listinfo/emacs-pretest-bug


Re: Mode-line display bug in XFT_JHD_BRANCH

2006-04-17 Thread Miles Bader
Baishampayan Ghose [EMAIL PROTECTED] writes:
 I guess now that the XFT  Unicode branches have been merged, this
 critical bug will be fixed. I can help with testing the branch by doing
 daily builds, if it's being developed actively. Miles, what do you think
 about this?

Well so far it's not being developed at all -- I've just created the branch.

There are people who have expressed interest in working on it but I
don't know how actively they can do so...

[If nobody jumps on it, I may try to fix up any compilation bugs and the
like, but I probably don't have the time to do real development on it.]

-miles
-- 
Americans are broad-minded people.  They'll accept the fact that a person can
be an alcoholic, a dope fiend, a wife beater, and even a newspaperman, but if a
man doesn't drive, there is something wrong with him.  -- Art Buchwald


___
emacs-pretest-bug mailing list
emacs-pretest-bug@gnu.org
http://lists.gnu.org/mailman/listinfo/emacs-pretest-bug