* nsfont.m (nsfont_draw): Fix up composition rendering.
authorAdrian Robert <Adrian.B.Robert@gmail.com>
Sat, 27 Sep 2008 19:07:15 +0000 (19:07 +0000)
committerAdrian Robert <Adrian.B.Robert@gmail.com>
Sat, 27 Sep 2008 19:07:15 +0000 (19:07 +0000)
src/ChangeLog
src/nsfont.m
src/nsterm.m

index 7ceacd2..aa372dd 100644 (file)
@@ -1,3 +1,8 @@
+2008-09-27  Adrian Robert  <Adrian.B.Robert@gmail.com>
+
+       * nsfont.m (nsfont_draw): Fix up composition rendering (cmp_from,
+       etc.).
+
 2008-09-27  Eli Zaretskii  <eliz@gnu.org>
 
        * composite.c (Fcomposition_get_gstring)
index 42507f0..8761e57 100644 (file)
@@ -902,16 +902,16 @@ nsfont_draw (struct glyph_string *s, int from, int to, int x, int y,
     XCharStruct *cs;
     int cwidth, twidth = 0;
     int hi, lo;
-    char isComposite = 0; /* s->first_glyph->type == COMPOSITE_GLYPH; */
+    char isComposite = s->first_glyph->type == COMPOSITE_GLYPH;
     /* FIXME: composition: no vertical displacement is considered. */
-    t+= s->cmp_from; /* advance into composition */
-    for (i =0; i<s->nchars - s->cmp_from; i++, t++)
+    t += s->cmp_from; /* advance into composition */
+    for (i = s->cmp_from; i < s->nchars; i++, t++)
       {
         hi = (*t & 0xFF00) >> 8;
         lo = *t & 0x00FF;
         if (isComposite)
           {
-            cwidth = s->cmp->offsets[s->cmp_from++ * 2] - twidth;
+            cwidth = s->cmp->offsets[i * 2] /* (H offset) */ - twidth;
           }
         else
           {
index 651b400..202f4a2 100644 (file)
@@ -2536,11 +2536,11 @@ hide_hourglass ()
 
 
 static inline NSRect
+ns_fix_rect_ibw (NSRect r, int fibw, int frame_pixel_width)
 /* --------------------------------------------------------------------------
     Under NS we draw internal borders inside fringes, and want full-width
     rendering to go all the way to edge.  This function makes that correction.
    -------------------------------------------------------------------------- */
-ns_fix_rect_ibw (NSRect r, int fibw, int frame_pixel_width)
 {
   if (r.origin.y <= fibw+1)
     {
@@ -5040,6 +5040,7 @@ if (NS_KEYLOG) NSLog (@"attributedSubstringFromRange request");
 
   if (emacsframe != old_focus)
     dpyinfo->x_focus_frame = emacsframe;
+
   /*/last_mouse_frame = emacsframe;? */
 
   if (val >= 0)