5 /* horizontal and vertical line characters */
6 static char *hs
[] = {"_", "\\_", "\\-", "\\(ru", "\\(ul", "\\(rn", NULL
};
7 static char *vs
[] = {"\\(bv", "\\(br", "|", NULL
};
9 static int cwid(char *c
)
11 struct glyph
*g
= dev_glyph(c
, n_f
);
12 return charwid(g
? g
->wid
: SC_DW
, n_s
);
15 static int lchar(char *c
, char **cs
)
18 if (!strcmp(*cs
++, c
))
23 static void vmov(struct adj
*adj
, int w
)
25 adj_put(adj
, w
, "\\v'%du'", w
);
28 static void hmov(struct adj
*adj
, int w
)
30 adj_put(adj
, w
, "\\h'%du'", w
);
33 void ren_hline(struct adj
*adj
, char *arg
)
37 l
= eval_up(&arg
, 0, 'm');
40 if (arg
[0] == '\\' && arg
[1] == '&') /* \& can be used as a separator */
45 /* negative length; moving backwards */
52 /* length less than character width */
56 hmov(adj
, -(w
- l
) / 2);
61 adj_put(adj
, w
, "%s", lc
);
67 for (i
= 0; i
< n
; i
++)
71 hmov(adj
, -(w
- l
+ 1) / 2);
74 void ren_vline(struct adj
*adj
, char *arg
)
77 int w
, l
, n
, i
, rem
, hw
, neg
;
78 l
= eval_up(&arg
, 0, 'm');
82 if (arg
[0] == '\\' && arg
[1] == '&') /* \& can be used as a separator */
86 w
= n_s
* SC_PT
; /* character height */
87 hw
= cwid(lc
); /* character width */
88 /* negative length; moving backwards */
95 /* length less than character width */
99 vmov(adj
, -w
+ l
/ 2);
101 /* the initial gap */
105 adj_put(adj
, hw
, "%s", lc
);
112 for (i
= 0; i
< n
; i
++) {
114 adj_put(adj
, hw
, lc
);