+ if (i == 0)
+ {
+ XSetFont (s->dpy, gc, s->metrics_font1->fid);
+ XSetForeground (s->dpy, gc, WhitePixelOfScreen (s->xgwa.screen));
+# ifdef HAVE_JWXYZ
+ 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,
+ s->metrics_xftfont,
+ xoff + x/2 + (sc*cc.rbearing/2) - cc.rbearing/2
+ + 40,
+ 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_JWXYZ
+ jwxyz_XSetAntiAliasing (s->dpy, gc, False);
+# endif
+ XSetFont (s->dpy, gc, s->metrics_font2->fid);
+ if (xft_p)
+ {
+ char *uptr;
+ char *tptr = txt2 + sprintf(txt2, "U+%04lX", s->debug_metrics_p);
+ *tptr++ = " ?_"[s->entering_unicode_p];
+ *tptr++ = ' ';
+
+ uptr = utxt;
+ while (*uptr)
+ {
+ tptr += sprintf (tptr, "0%03o ", (unsigned char) *uptr);
+ ++uptr;
+ }
+ *tptr++ = ' ';
+ uptr = utxt;
+ while (*uptr)
+ {
+ tptr += sprintf (tptr, "%02x ", (unsigned char) *uptr);
+ ++uptr;
+ }
+ }
+ else
+ sprintf (txt2, "%c %3ld 0%03lo 0x%02lx%s",
+ (char)s->debug_metrics_p, s->debug_metrics_p,
+ s->debug_metrics_p, s->debug_metrics_p,
+ (txt[0] < s->metrics_font1->min_char_or_byte2
+ ? " *" : ""));
+ XDrawString (s->dpy, dest, gc,
+ xoff + 10, 20,
+ txt2, strlen(txt2));
+ }
+
+# ifdef HAVE_JWXYZ
+ 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, s->metrics_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 + 50,
+ 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 + 60,
+ 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; */