diff src/nsfont.m @ 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 e77a63e6f983
children 6b3b02fd9846
line wrap: on
line diff
--- 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
           {