+ lx = x = frag->x;
+ ly = y = frag->y;
+
+ /*
+ * See if we're going to use Tj (show a single
+ * string) or TJ (show an array of strings with
+ * x-spacings between them). We determine this by
+ * seeing if there's more than one text fragment in
+ * sequence with the same y-coordinate.
+ */
+ if (frag->next && frag->next != frag_end &&
+ frag->next->y == y) {
+ /*
+ * The TJ strategy.
+ */
+ objstream(cstr, "[");
+ while (frag && frag != frag_end && frag->y == y) {
+ if (frag->x != x) {
+ sprintf(buf, "%g",
+ (x - frag->x) * 1000.0 /
+ (4096.0 * frag->fontsize));
+ objstream(cstr, buf);
+ }
+ pdf_string(objstream, cstr, frag->text);
+ x = frag->x + frag->width;
+ frag = frag->next;
+ }
+ objstream(cstr, "]TJ\n");
+ } else
+ {
+ /*
+ * The Tj strategy.
+ */
+ pdf_string(objstream, cstr, frag->text);
+ objstream(cstr, "Tj\n");
+ frag = frag->next;
+ }