8 int i, sub, nstr, at, with, hset;
9 double xwith, ywith, h, w, x0, y0, x1, y1;
13 at = with = nstr = hset = 0;
14 h = getfval("textht");
15 w = getfval("textwid");
16 for (i = 0; i < nattr; i++) {
37 if (ap->a_val.p == NULL) /* an isolated modifier */
38 text[ntext-1].t_type = sub;
40 savetext(sub, ap->a_val.p);
46 if (hset == 0) /* no explicit ht cmd */
51 case NORTH: ywith = -h / 2; break;
52 case SOUTH: ywith = h / 2; break;
53 case EAST: xwith = -w / 2; break;
54 case WEST: xwith = w / 2; break;
55 case NE: xwith = -w / 2; ywith = -h / 2; break;
56 case SE: xwith = -w / 2; ywith = h / 2; break;
57 case NW: xwith = w / 2; ywith = -h / 2; break;
58 case SW: xwith = w / 2; ywith = h / 2; break;
66 else if (isleft(hvmode))
68 else if (isup(hvmode))
79 dprintf("Text h %g w %g at %g,%g\n", h, w, curx, cury);
80 p = makenode(TEXT, 2);
85 else if (isleft(hvmode))
87 else if (isup(hvmode))
95 troffgen(char *s) /* save away a string of troff commands */
97 savetext(CENTER, s); /* use the existing text mechanism */
98 return makenode(TROFF, 0);
102 savetext(int t, char *s) /* record text elements for current object */
104 if (ntext >= ntextlist)
105 text = (Text *) grow((char *) text, "text", ntextlist += 200, sizeof(Text));
106 text[ntext].t_type = t;
107 text[ntext].t_val = s;
108 dprintf("saving %d text %s at %d\n", t, s, ntext);