+ if (p->flags & TERMP_BACKAFTER)
+ p->flags &= ~TERMP_BACKAFTER;
+ else if (*word == '\0')
+ p->flags |= (TERMP_NOSPACE | TERMP_NONEWLINE);
+ continue;
+ case ESCAPE_DEVICE:
+ if (p->type == TERMTYPE_PDF)
+ encode(p, "pdf", 3);
+ else if (p->type == TERMTYPE_PS)
+ encode(p, "ps", 2);
+ else if (p->enc == TERMENC_ASCII)
+ encode(p, "ascii", 5);
+ else
+ encode(p, "utf8", 4);
+ continue;
+ case ESCAPE_HORIZ:
+ if (*seq == '|') {
+ seq++;
+ uc = -p->col;
+ } else
+ uc = 0;
+ if (a2roffsu(seq, &su, SCALE_EM) == NULL)
+ continue;
+ uc += term_hen(p, &su);
+ if (uc > 0)
+ while (uc-- > 0)
+ bufferc(p, ASCII_NBRSP);
+ else if (p->col > (size_t)(-uc))
+ p->col += uc;
+ else {
+ uc += p->col;
+ p->col = 0;
+ if (p->tcol->offset > (size_t)(-uc)) {
+ p->ti += uc;
+ p->tcol->offset += uc;
+ } else {
+ p->ti -= p->tcol->offset;
+ p->tcol->offset = 0;
+ }
+ }
+ continue;
+ case ESCAPE_HLINE:
+ if ((cp = a2roffsu(seq, &su, SCALE_EM)) == NULL)
+ continue;
+ uc = term_hen(p, &su);
+ if (uc <= 0) {
+ if (p->tcol->rmargin <= p->tcol->offset)
+ continue;
+ lsz = p->tcol->rmargin - p->tcol->offset;
+ } else
+ lsz = uc;
+ if (*cp == seq[-1])
+ uc = -1;
+ else if (*cp == '\\') {
+ seq = cp + 1;
+ esc = mandoc_escape(&seq, &cp, &sz);
+ switch (esc) {
+ case ESCAPE_UNICODE:
+ uc = mchars_num2uc(cp + 1, sz - 1);
+ break;
+ case ESCAPE_NUMBERED:
+ uc = mchars_num2char(cp, sz);
+ break;
+ case ESCAPE_SPECIAL:
+ uc = mchars_spec2cp(cp, sz);
+ break;
+ case ESCAPE_UNDEF:
+ uc = *seq;
+ break;
+ default:
+ uc = -1;
+ break;
+ }
+ } else
+ uc = *cp;
+ if (uc < 0x20 || (uc > 0x7E && uc < 0xA0))
+ uc = '_';
+ if (p->enc == TERMENC_ASCII) {
+ cp = ascii_uc2str(uc);
+ csz = term_strlen(p, cp);
+ ssz = strlen(cp);
+ } else
+ csz = (*p->width)(p, uc);
+ while (lsz >= csz) {
+ if (p->enc == TERMENC_ASCII)
+ encode(p, cp, ssz);
+ else
+ encode1(p, uc);
+ lsz -= csz;
+ }