=================================================================== RCS file: /cvs/mandoc/roff_term.c,v retrieving revision 1.16 retrieving revision 1.17 diff -u -p -r1.16 -r1.17 --- mandoc/roff_term.c 2018/12/14 01:18:26 1.16 +++ mandoc/roff_term.c 2018/12/16 00:17:02 1.17 @@ -1,4 +1,4 @@ -/* $Id: roff_term.c,v 1.16 2018/12/14 01:18:26 schwarze Exp $ */ +/* $Id: roff_term.c,v 1.17 2018/12/16 00:17:02 schwarze Exp $ */ /* * Copyright (c) 2010,2014,2015,2017,2018 Ingo Schwarze * @@ -18,6 +18,7 @@ #include #include +#include #include "mandoc.h" #include "roff.h" @@ -113,25 +114,22 @@ roff_term_pre_ft(ROFF_TERM_ARGS) { const char *cp; - if (*(cp = n->child->string) == 'C') - cp++; - - switch (*cp) { - case '4': - case '3': - case 'B': + 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: