]> git.eshelyaron.com Git - emacs.git/commitdiff
(struct glyph_string): New member padding_p.
authorKenichi Handa <handa@m17n.org>
Mon, 25 Feb 2008 01:52:35 +0000 (01:52 +0000)
committerKenichi Handa <handa@m17n.org>
Mon, 25 Feb 2008 01:52:35 +0000 (01:52 +0000)
src/ChangeLog
src/dispextern.h
src/xdisp.c

index 71026e1d77e32965d5d1a4defd41cdd4cc151874..263168d128b4174ebe3656b1c159f2bbb47c61d2 100644 (file)
@@ -1,3 +1,22 @@
+2008-02-25  Kenichi Handa  <handa@ni.aist.go.jp>
+
+       * xdisp.c (fill_glyph_string): Pay attention to glyph->padding_p.
+       (append_glyph): Set glyph->pixel_width and glyph->padding_p to 1
+       if the glyph in the font is zero pixel with.
+
+       * dispextern.h (struct glyph_string): New member padding_p.
+
+       * w32font.c (w32font_draw): Pay attention to s->padding_p.
+
+       * ftxfont.c (ftxfont_draw): Pay attention to s->padding_p.
+
+       * xfont.c (xfont_draw): Pay attention to s->padding_p.
+
+       * xftfont.c (xftfont_draw): Pay attention to s->padding_p.
+
+       * font.c: If the font driver doesn't have `shape' function, return
+       Qnil.
+
 2008-02-25  Jason Rumney  <jasonr@gnu.org>
 
        * w32fns.c (enum_font_cb2): Don't use raster fonts for Unicode.
index ea5a077d7b215e19a4b739c6b76a8039b74db043..652980be7838191b5c93b034dab38842884c1eb8 100644 (file)
@@ -351,13 +351,16 @@ struct glyph
      glyphs above or below it.  */
   unsigned overlaps_vertically_p : 1;
 
-  /* 1 means glyph is a padding glyph.  Padding glyphs are used for
-     characters whose visual shape consists of more than one glyph
-     (e.g. Asian characters).  All but the first glyph of such a glyph
-     sequence have the padding_p flag set.  Only used for terminal
-     frames, and there only to minimize code changes.  A better way
-     would probably be to use the width field of glyphs to express
-     padding. */
+  /* For terminal frames, 1 means glyph is a padding glyph.  Padding
+     glyphs are used for characters whose visual shape consists of
+     more than one glyph (e.g. Asian characters).  All but the first
+     glyph of such a glyph sequence have the padding_p flag set.  This
+     flag is used only to minimize code changes.  A better way would
+     probably be to use the width field of glyphs to express padding.
+
+     For graphic frames, 1 means the pixel width of the glyph in a
+     font is 0, but 1-pixel is padded on displaying for correct cursor
+     displaying.  The member `pixel_width' above is set to 1.  */
   unsigned padding_p : 1;
 
   /* 1 means the actual glyph is not available, draw a box instead.
@@ -1197,6 +1200,11 @@ struct glyph_string
      respectively.  */
   unsigned for_overlaps : 3;
 
+  /* 1 means that all glyphs in this glyph string has the flag
+     padding_p set, and thus must be drawn one by one to have 1-pixel
+     width even though the logical width in the font is zero.  */
+  unsigned padding_p : 1;
+
   /* The GC to use for drawing this glyph string.  */
 #if defined(HAVE_X_WINDOWS) || defined(MAC_OS)
   GC gc;
index 588d145e9e14bc0e90475d1f505b5c6285dca255..1e2a667330e38e5e9727fd0a5b3dd93659065d1f 100644 (file)
@@ -19409,7 +19409,7 @@ fill_glyph_string (s, face_id, start, end, overlaps)
   glyph = s->row->glyphs[s->area] + start;
   last = s->row->glyphs[s->area] + end;
   voffset = glyph->voffset;
-
+  s->padding_p = glyph->padding_p;
   glyph_not_available_p = glyph->glyph_not_available_p;
 
   while (glyph < last
@@ -19428,7 +19428,8 @@ fill_glyph_string (s, face_id, start, end, overlaps)
       ++s->nchars;
       xassert (s->nchars <= end - start);
       s->width += glyph->pixel_width;
-      ++glyph;
+      if (glyph++->padding_p != s->padding_p)
+       break;
     }
 
   s->font = s->face->font;
@@ -20181,7 +20182,18 @@ append_glyph (it)
     {
       glyph->charpos = CHARPOS (it->position);
       glyph->object = it->object;
-      glyph->pixel_width = it->pixel_width;
+      if (it->pixel_width > 0)
+       {
+         glyph->pixel_width = it->pixel_width;
+         glyph->padding_p = 0;
+       }
+      else
+       {
+         /* Assure at least 1-pixel width.  Otherwise, cursor can't
+            be displayed correctly.  */
+         glyph->pixel_width = 1;
+         glyph->padding_p = 1;
+       }
       glyph->ascent = it->ascent;
       glyph->descent = it->descent;
       glyph->voffset = it->voffset;
@@ -20191,7 +20203,6 @@ append_glyph (it)
       glyph->right_box_line_p = it->end_of_box_run_p;
       glyph->overlaps_vertically_p = (it->phys_ascent > it->ascent
                                      || it->phys_descent > it->descent);
-      glyph->padding_p = 0;
       glyph->glyph_not_available_p = it->glyph_not_available_p;
       glyph->face_id = it->face_id;
       glyph->u.ch = it->char_to_display;