=================================================================== RCS file: /cvs/mandoc/tbl_term.c,v retrieving revision 1.74 retrieving revision 1.77 diff -u -p -r1.74 -r1.77 --- mandoc/tbl_term.c 2020/10/25 18:28:23 1.74 +++ mandoc/tbl_term.c 2022/04/14 16:43:44 1.77 @@ -1,7 +1,7 @@ -/* $Id: tbl_term.c,v 1.74 2020/10/25 18:28:23 schwarze Exp $ */ +/* $Id: tbl_term.c,v 1.77 2022/04/14 16:43:44 schwarze Exp $ */ /* + * Copyright (c) 2011-2021 Ingo Schwarze * Copyright (c) 2009, 2011 Kristaps Dzonsons - * Copyright (c) 2011-2020 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 @@ -25,6 +25,9 @@ #include #include +#if DEBUG_MEMORY +#include "mandoc_dbg.h" +#endif #include "mandoc.h" #include "tbl.h" #include "out.h" @@ -820,8 +823,11 @@ tbl_literal(struct termp *tp, const struct tbl_dat *dp width = col->width; ic = dp->layout->col; hspans = dp->hspans; - while (hspans--) - width += tp->tbl.cols[++ic].width + 3; + while (hspans--) { + width += tp->tbl.cols[ic].spacing; + ic++; + width += tp->tbl.cols[ic].width; + } padr = width > len ? width - len : 0; padl = 0; @@ -923,10 +929,24 @@ tbl_word(struct termp *tp, const struct tbl_dat *dp) int prev_font; prev_font = tp->fonti; - 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); + switch (dp->layout->font) { + case ESCAPE_FONTBI: + term_fontpush(tp, TERMFONT_BI); + break; + case ESCAPE_FONTBOLD: + case ESCAPE_FONTCB: + term_fontpush(tp, TERMFONT_BOLD); + break; + case ESCAPE_FONTITALIC: + case ESCAPE_FONTCI: + term_fontpush(tp, TERMFONT_UNDER); + break; + case ESCAPE_FONTROMAN: + case ESCAPE_FONTCR: + break; + default: + abort(); + } term_word(tp, dp->string);