=================================================================== RCS file: /cvsrepo/anoncvs/cvs/src/usr.bin/mandoc/tbl_term.c,v retrieving revision 1.16 retrieving revision 1.17 diff -u -r1.16 -r1.17 --- src/usr.bin/mandoc/tbl_term.c 2014/04/20 16:44:44 1.16 +++ src/usr.bin/mandoc/tbl_term.c 2014/10/13 23:31:26 1.17 @@ -1,4 +1,4 @@ -/* $Id: tbl_term.c,v 1.16 2014/04/20 16:44:44 schwarze Exp $ */ +/* $OpenBSD: tbl_term.c,v 1.17 2014/10/13 23:31:26 schwarze Exp $ */ /* * Copyright (c) 2009, 2011 Kristaps Dzonsons * Copyright (c) 2011, 2012, 2014 Ingo Schwarze @@ -15,6 +15,8 @@ * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. */ +#include + #include #include #include @@ -39,6 +41,7 @@ const struct roffcol *); static void tbl_hrule(struct termp *, const struct tbl_span *); static void tbl_vrule(struct termp *, const struct tbl_head *); +static void tbl_word(struct termp *, const struct tbl_dat *); static size_t @@ -374,7 +377,7 @@ } tbl_char(tp, ASCII_NBRSP, padl); - term_word(tp, dp->string); + tbl_word(tp, dp); tbl_char(tp, ASCII_NBRSP, padr); } @@ -415,8 +418,23 @@ padl = col->decimal - d; tbl_char(tp, ASCII_NBRSP, padl); - term_word(tp, dp->string); + tbl_word(tp, dp); if (col->width > sz + padl) tbl_char(tp, ASCII_NBRSP, col->width - sz - padl); } +static void +tbl_word(struct termp *tp, const struct tbl_dat *dp) +{ + const void *prev_font; + + prev_font = term_fontq(tp); + if (dp->layout->flags & TBL_CELL_BOLD) + term_fontpush(tp, TERMFONT_BOLD); + else if (dp->layout->flags & TBL_CELL_ITALIC) + term_fontpush(tp, TERMFONT_UNDER); + + term_word(tp, dp->string); + + term_fontpopq(tp, prev_font); +}