=================================================================== RCS file: /cvs/mandoc/roff_term.c,v retrieving revision 1.13 retrieving revision 1.18 diff -u -p -r1.13 -r1.18 --- mandoc/roff_term.c 2017/06/14 22:51:25 1.13 +++ mandoc/roff_term.c 2018/12/31 07:08:12 1.18 @@ -1,6 +1,6 @@ -/* $Id: roff_term.c,v 1.13 2017/06/14 22:51:25 schwarze Exp $ */ +/* $Id: roff_term.c,v 1.18 2018/12/31 07:08:12 schwarze Exp $ */ /* - * Copyright (c) 2010, 2014, 2015, 2017 Ingo Schwarze + * Copyright (c) 2010,2014,2015,2017,2018 Ingo Schwarze * * Permission to use, copy, modify, and distribute this software for any * purpose with or without fee is hereby granted, provided that the above @@ -17,8 +17,10 @@ #include #include -#include +#include +#include +#include "mandoc.h" #include "roff.h" #include "out.h" #include "term.h" @@ -40,9 +42,11 @@ static void roff_term_pre_ti(ROFF_TERM_ARGS); static const roff_term_pre_fp roff_term_pre_acts[ROFF_MAX] = { roff_term_pre_br, /* br */ roff_term_pre_ce, /* ce */ + roff_term_pre_br, /* fi */ roff_term_pre_ft, /* ft */ roff_term_pre_ll, /* ll */ roff_term_pre_mc, /* mc */ + roff_term_pre_br, /* nf */ roff_term_pre_po, /* po */ roff_term_pre_ce, /* rj */ roff_term_pre_sp, /* sp */ @@ -65,7 +69,9 @@ roff_term_pre_br(ROFF_TERM_ARGS) if (p->flags & TERMP_BRIND) { p->tcol->offset = p->tcol->rmargin; p->tcol->rmargin = p->maxrmargin; + p->trailspace = 0; p->flags &= ~(TERMP_NOBREAK | TERMP_BRIND); + p->flags |= TERMP_NOSPACE; } } @@ -110,22 +116,24 @@ roff_term_pre_ce(ROFF_TERM_ARGS) static void roff_term_pre_ft(ROFF_TERM_ARGS) { - switch (*n->child->string) { - case '4': - case '3': - case 'B': + const char *cp; + + cp = n->child->string; + switch (mandoc_font(cp, (int)strlen(cp))) { + case ESCAPE_FONTBOLD: term_fontrepl(p, TERMFONT_BOLD); break; - case '2': - case 'I': + case ESCAPE_FONTITALIC: term_fontrepl(p, TERMFONT_UNDER); break; - case 'P': + case ESCAPE_FONTBI: + term_fontrepl(p, TERMFONT_BI); + break; + case ESCAPE_FONTPREV: term_fontlast(p); break; - case '1': - case 'C': - case 'R': + case ESCAPE_FONTROMAN: + case ESCAPE_FONTCW: term_fontrepl(p, TERMFONT_NONE); break; default: