changeset 98371:713cc05ca791

* nsfont.m (nsfont_draw): Fix up composition rendering.
author Adrian Robert <Adrian.B.Robert@gmail.com>
date Sat, 27 Sep 2008 19:07:15 +0000
parents 02578383508d
children dfb0ac991c30
files src/ChangeLog src/nsfont.m src/nsterm.m
diffstat 3 files changed, 11 insertions(+), 5 deletions(-) [+]
line wrap: on
line diff
--- a/src/ChangeLog	Sat Sep 27 13:10:56 2008 +0000
+++ b/src/ChangeLog	Sat Sep 27 19:07:15 2008 +0000
@@ -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)
--- a/src/nsfont.m	Sat Sep 27 13:10:56 2008 +0000
+++ b/src/nsfont.m	Sat Sep 27 19:07:15 2008 +0000
@@ -902,16 +902,16 @@
     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
           {
--- a/src/nsterm.m	Sat Sep 27 13:10:56 2008 +0000
+++ b/src/nsterm.m	Sat Sep 27 19:07:15 2008 +0000
@@ -2536,11 +2536,11 @@
 
 
 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 (emacsframe != old_focus)
     dpyinfo->x_focus_frame = emacsframe;
+
   /*/last_mouse_frame = emacsframe;? */
 
   if (val >= 0)