+ if (i == 0)
+ {
+ XSetFont (s->dpy, gc, font->fid);
+ XSetForeground (s->dpy, gc, WhitePixelOfScreen (s->xgwa.screen));
+# ifdef HAVE_COCOA
+ jwxyz_XSetAntiAliasing (s->dpy, gc, s->debug_metrics_antialiasing_p);
+# endif
+ sprintf (txt2, "%s [XX%sXX] [%s%s%s%s]",
+ (xft_p ? utxt : txt),
+ (xft_p ? utxt : txt),
+ (xft_p ? utxt : txt),
+ (xft_p ? utxt : txt),
+ (xft_p ? utxt : txt),
+ (xft_p ? utxt : txt));
+
+ if (xft_p)
+ XftDrawStringUtf8 (xftdraw, &xftcolor, xftfont,
+ xoff + x/2 + (sc*cc.rbearing/2) - cc.rbearing/2,
+ ascent + 10,
+ (FcChar8 *) txt2, strlen(txt2));
+ else
+ XDrawString (s->dpy, dest, gc,
+ xoff + x/2 + (sc*cc.rbearing/2) - cc.rbearing/2,
+ ascent + 10,
+ txt2, strlen(txt2));
+# ifdef HAVE_COCOA
+ jwxyz_XSetAntiAliasing (s->dpy, gc, False);
+# endif
+ XSetFont (s->dpy, gc, font2->fid);
+ if (xft_p && utxt[1])
+ sprintf (txt2, "0%03o 0%03o %02x %02x",
+ (unsigned char) utxt[0], (unsigned char) utxt[1],
+ (unsigned char) utxt[0], (unsigned char) utxt[1]);
+ else if (xft_p)
+ txt2[0] = 0;
+ else
+ sprintf (txt2, "%c %3d 0%03o 0x%02x%s",
+ s->debug_metrics_p, s->debug_metrics_p,
+ s->debug_metrics_p, s->debug_metrics_p,
+ (txt[0] < font->min_char_or_byte2 ? " *" : ""));
+ XDrawString (s->dpy, dest, gc,
+ xoff + 10, 20,
+ txt2, strlen(txt2));
+ }
+
+# ifdef HAVE_COCOA
+ jwxyz_XSetAntiAliasing (s->dpy, gc, True);
+# endif
+
+ {
+ const char *ss = (j == 0
+ ? (i == 0 ? "char" : "overall")
+ : (i == 0 ? "utf8" : "16 bit"));
+ XSetFont (s->dpy, gc, font2->fid);
+
+ XSetForeground (s->dpy, gc, red);
+
+ sprintf (txt2, "%s ascent %d", ss, ascent);
+ XDrawString (s->dpy, dest, gc,
+ xoff + 10,
+ y - sc*ascent - 2,
+ txt2, strlen(txt2));
+ XDrawLine (s->dpy, dest, gc,
+ xoff, y - sc*ascent,
+ x3, y - sc*ascent);
+
+ sprintf (txt2, "%s descent %d", ss, descent);
+ XDrawString (s->dpy, dest, gc,
+ xoff + 10,
+ y + sc*descent - 2,
+ txt2, strlen(txt2));
+ XDrawLine (s->dpy, dest, gc,
+ xoff, y + sc*descent,
+ x3, y + sc*descent);
+ }
+
+
+ /* ascent, descent, baseline */
+
+ XSetForeground (s->dpy, gc, green);
+
+ sprintf (txt2, "ascent %d", cc.ascent);
+ if (cc.ascent != 0)
+ XDrawString (s->dpy, dest, gc,
+ x1, y - sc*cc.ascent - 2,
+ txt2, strlen(txt2));
+ XDrawLine (s->dpy, dest, gc,
+ x1, y - sc*cc.ascent,
+ x2, y - sc*cc.ascent);
+
+ sprintf (txt2, "descent %d", cc.descent);
+ if (cc.descent != 0)
+ XDrawString (s->dpy, dest, gc,
+ x1, y + sc*cc.descent - 2,
+ txt2, strlen(txt2));
+ XDrawLine (s->dpy, dest, gc,
+ x1, y + sc*cc.descent,
+ x2, y + sc*cc.descent);
+
+ XSetForeground (s->dpy, gc, yellow);
+ strcpy (txt2, "baseline");
+ XDrawString (s->dpy, dest, gc,
+ x1, y - 2,
+ txt2, strlen(txt2));
+ XDrawLine (s->dpy, dest, gc, x1, y, x2, y);
+
+
+ /* origin, width */
+
+ XSetForeground (s->dpy, gc, blue);
+
+ strcpy (txt2, "origin");
+ XDrawString (s->dpy, dest, gc,
+ xoff + x + 2,
+ y + sc*(descent + 10),
+ txt2, strlen(txt2));
+ XDrawLine (s->dpy, dest, gc,
+ xoff + x, y - sc*(ascent - 10),
+ xoff + x, y + sc*(descent + 10));
+
+ sprintf (txt2, "width %d", cc.width);
+ XDrawString (s->dpy, dest, gc,
+ xoff + x + sc*cc.width + 2,
+ y + sc*(descent + 10) + 10,
+ txt2, strlen(txt2));
+ XDrawLine (s->dpy, dest, gc,
+ xoff + x + sc*cc.width, y - sc*(ascent - 10),
+ xoff + x + sc*cc.width, y + sc*(descent + 10));
+
+
+ /* lbearing, rbearing */
+
+ XSetForeground (s->dpy, gc, green);
+
+ sprintf (txt2, "lbearing %d", cc.lbearing);
+ XDrawString (s->dpy, dest, gc,
+ xoff + x + sc*cc.lbearing + 2,
+ y + sc * descent + 30,
+ txt2, strlen(txt2));
+ XDrawLine (s->dpy, dest, gc,
+ xoff + x + sc*cc.lbearing, y - sc*ascent,
+ xoff + x + sc*cc.lbearing, y + sc*descent + 20);
+
+ sprintf (txt2, "rbearing %d", cc.rbearing);
+ XDrawString (s->dpy, dest, gc,
+ xoff + x + sc*cc.rbearing + 2,
+ y + sc * descent + 40,
+ txt2, strlen(txt2));
+ XDrawLine (s->dpy, dest, gc,
+ xoff + x + sc*cc.rbearing, y - sc*ascent,
+ xoff + x + sc*cc.rbearing, y + sc*descent + 40);
+
+ y += sc * (ascent + descent) * 2;