in the tbl(7) layout font modifier.
Get rid of the TBL_CELL_BOLD and TBL_CELL_ITALIC flags and use
the usual ESCAPE_FONT* enum mandoc_esc members from mandoc.h instead,
which simplifies and unifies some code.
While here, also support CB and CI in roff(7) \f escape sequences
and in roff(7) .ft requests for all output modes. Using those is
certainly not recommended because portability is limited even with
groff, but supporting them makes some existing third-party manual
pages look better, in particular in HTML output mode.
Bug-compatible with groff as far as i'm aware, except that i consider
font names starting with the '\n' (ASCII 0x0a line feed) character
so insane that i decided to not support them.
Missing feature reported by nabijaczleweli dot xyz in
https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=992002.
I used none of the code from the initial patch submitted by
nabijaczleweli, but some of their ideas.
Final patch tested by them, too.
-/* $Id: html.c,v 1.273 2021/06/02 17:51:38 schwarze Exp $ */
+/* $Id: html.c,v 1.274 2021/08/10 12:55:03 schwarze Exp $ */
/*
- * Copyright (c) 2011-2015, 2017-2020 Ingo Schwarze <schwarze@openbsd.org>
* Copyright (c) 2008-2011, 2014 Kristaps Dzonsons <kristaps@bsd.lv>
+ * Copyright (c) 2011-2015, 2017-2021 Ingo Schwarze <schwarze@openbsd.org>
*
* Permission to use, copy, modify, and distribute this software for any
* purpose with or without fee is hereby granted, provided that the above
case ESCAPE_FONTITALIC:
case ESCAPE_FONTBOLD:
case ESCAPE_FONTBI:
- case ESCAPE_FONTCW:
case ESCAPE_FONTROMAN:
+ case ESCAPE_FONTCR:
+ case ESCAPE_FONTCB:
+ case ESCAPE_FONTCI:
break;
case ESCAPE_FONT:
font = ESCAPE_FONTROMAN;
h->metaf = print_otag(h, TAG_B, "");
print_otag(h, TAG_I, "");
break;
- case ESCAPE_FONTCW:
+ case ESCAPE_FONTCR:
h->metaf = print_otag(h, TAG_SPAN, "c", "Li");
break;
+ case ESCAPE_FONTCB:
+ h->metaf = print_otag(h, TAG_SPAN, "c", "Li");
+ print_otag(h, TAG_B, "");
+ break;
+ case ESCAPE_FONTCI:
+ h->metaf = print_otag(h, TAG_SPAN, "c", "Li");
+ print_otag(h, TAG_I, "");
+ break;
default:
break;
}
case ESCAPE_FONTBOLD:
case ESCAPE_FONTITALIC:
case ESCAPE_FONTBI:
- case ESCAPE_FONTCW:
case ESCAPE_FONTROMAN:
+ case ESCAPE_FONTCR:
+ case ESCAPE_FONTCB:
+ case ESCAPE_FONTCI:
if (0 == norecurse) {
h->flags |= HTML_NOSPACE;
if (html_setfont(h, esc))
-/* $Id: man_validate.c,v 1.155 2020/10/30 13:24:33 schwarze Exp $ */
+/* $Id: man_validate.c,v 1.156 2021/08/10 12:55:03 schwarze Exp $ */
/*
* Copyright (c) 2010, 2012-2020 Ingo Schwarze <schwarze@openbsd.org>
* Copyright (c) 2008, 2009, 2010, 2011 Kristaps Dzonsons <kristaps@bsd.lv>
case ESCAPE_FONTITALIC:
case ESCAPE_FONTBI:
case ESCAPE_FONTROMAN:
- case ESCAPE_FONTCW:
+ case ESCAPE_FONTCR:
+ case ESCAPE_FONTCB:
+ case ESCAPE_FONTCI:
case ESCAPE_FONTPREV:
case ESCAPE_IGNORE:
break;
-/* $Id: mandoc.c,v 1.118 2020/10/24 22:57:39 schwarze Exp $ */
+/* $Id: mandoc.c,v 1.119 2021/08/10 12:55:03 schwarze Exp $ */
/*
* Copyright (c) 2008-2011, 2014 Kristaps Dzonsons <kristaps@bsd.lv>
- * Copyright (c) 2011-2015, 2017-2020 Ingo Schwarze <schwarze@openbsd.org>
+ * Copyright (c) 2011-2015, 2017-2021 Ingo Schwarze <schwarze@openbsd.org>
*
* Permission to use, copy, modify, and distribute this software for any
* purpose with or without fee is hereby granted, provided that the above
case 'C':
switch (cp[1]) {
case 'B':
- return ESCAPE_FONTBOLD;
+ return ESCAPE_FONTCB;
case 'I':
- return ESCAPE_FONTITALIC;
+ return ESCAPE_FONTCI;
case 'R':
case 'W':
- return ESCAPE_FONTCW;
+ return ESCAPE_FONTCR;
default:
return ESCAPE_ERROR;
}
-/* $Id: mandoc.h,v 1.272 2021/07/04 15:38:26 schwarze Exp $ */
+/* $Id: mandoc.h,v 1.273 2021/08/10 12:55:03 schwarze Exp $ */
/*
* Copyright (c) 2012-2021 Ingo Schwarze <schwarze@openbsd.org>
* Copyright (c) 2010, 2011, 2014 Kristaps Dzonsons <kristaps@bsd.lv>
ESCAPE_FONTITALIC, /* italic font mode */
ESCAPE_FONTBI, /* bold italic font mode */
ESCAPE_FONTROMAN, /* roman font mode */
- ESCAPE_FONTCW, /* constant width font mode */
+ ESCAPE_FONTCR, /* constant width font mode */
+ ESCAPE_FONTCB, /* constant width bold font mode */
+ ESCAPE_FONTCI, /* constant width italic font mode */
ESCAPE_FONTPREV, /* previous font mode */
ESCAPE_NUMBERED, /* a numbered glyph */
ESCAPE_UNICODE, /* a unicode codepoint */
-.\" $Id: mandoc_headers.3,v 1.33 2020/03/13 15:32:28 schwarze Exp $
+.\" $Id: mandoc_headers.3,v 1.34 2021/08/10 12:55:03 schwarze Exp $
.\"
-.\" Copyright (c) 2014-2020 Ingo Schwarze <schwarze@openbsd.org>
+.\" Copyright (c) 2014-2021 Ingo Schwarze <schwarze@openbsd.org>
.\"
.\" Permission to use, copy, modify, and distribute this software for any
.\" purpose with or without fee is hereby granted, provided that the above
.\" ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
.\" OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
.\"
-.Dd $Mdocdate: March 13 2020 $
+.Dd $Mdocdate: August 10 2021 $
.Dt MANDOC_HEADERS 3
.Os
.Sh NAME
Requires
.In sys/types.h
for
-.Vt size_t .
+.Vt size_t
+and
+.Qq Pa mandoc.h
+for
+.Vt enum mandoc_esc .
.Pp
Provides
.Vt enum tbl_cellt ,
-/* $Id: mdoc_markdown.c,v 1.36 2020/06/22 19:20:40 schwarze Exp $ */
+/* $Id: mdoc_markdown.c,v 1.37 2021/08/10 12:55:03 schwarze Exp $ */
/*
* Copyright (c) 2017, 2018, 2020 Ingo Schwarze <schwarze@openbsd.org>
*
md_rawword("markdown");
continue;
case ESCAPE_FONTBOLD:
+ case ESCAPE_FONTCB:
nextfont = "**";
break;
case ESCAPE_FONTITALIC:
+ case ESCAPE_FONTCI:
nextfont = "*";
break;
case ESCAPE_FONTBI:
nextfont = "***";
break;
case ESCAPE_FONT:
- case ESCAPE_FONTCW:
+ case ESCAPE_FONTCR:
case ESCAPE_FONTROMAN:
nextfont = "";
break;
-/* $Id: out.c,v 1.79 2019/12/31 22:58:41 schwarze Exp $ */
+/* $Id: out.c,v 1.80 2021/08/10 12:55:03 schwarze Exp $ */
/*
* Copyright (c) 2009, 2010, 2011 Kristaps Dzonsons <kristaps@bsd.lv>
* Copyright (c) 2011,2014,2015,2017,2018 Ingo Schwarze <schwarze@openbsd.org>
#include <assert.h>
#include <ctype.h>
#include <stdint.h>
+#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <time.h>
#include "mandoc_aux.h"
+#include "mandoc.h"
#include "tbl.h"
#include "out.h"
numbers: <b><i>bolditalic</i></b><b>bold</b><i>italic</i>roman
letters: <b>bold</b><i>italic</i><b>back</b><b><i>bolditalic</i></b>roman
multiletter: <b>bold</b>empty<i>italic</i>back<b><i>bolditalic</i></b>roman
-typewriter: <span class="Li">roman</span><b>bold</b><span class="Li">roman</span><i>italic</i>roman
+typewriter: <span class="Li">roman</span><span class="Li"><b>bold</b></span><span class="Li">roman</span><span class="Li"><i>italic</i></span>roman
<br/>
default font <i>italic</i> <b><i>bold italic</i></b>
- <span class="Li">typeqriter</span> <span class="Li">roman</span> <b>bold</b>
- <i>italic</i> <b>bold</b> <b>still bold</b> <i>italic</i> <i>back to
- bold</i> <i>back to italic</i>
+ <span class="Li">typeqriter</span> <span class="Li">roman</span>
+ <span class="Li"><b>bold</b></span> <span class="Li"><i>italic</i></span>
+ <b>bold</b> <b>still bold</b> <i>italic</i> <i>back to bold</i> <i>back to
+ italic</i>
<br/>
-# $OpenBSD: Makefile,v 1.2 2015/02/10 11:02:19 schwarze Exp $
+# $OpenBSD: Makefile,v 1.6 2021/08/10 12:36:42 schwarze Exp $
-REGRESS_TARGETS = badfont expand expand-toowide font misalign spacing width
-LINT_TARGETS = badfont font
+REGRESS_TARGETS = badfont expand expand-toowide font font-eol
+REGRESS_TARGETS += misalign spacing width
+LINT_TARGETS = badfont font font-eol
-# groff-1.22.3 defects:
+# groff-1.22.4 defects:
# - The "f" font modifier swallows a following newline character.
# - When space is insufficient (on either side) for properly aligning
# a number, GNU tbl(1) moves the number too much to the right,
# overflowing the column, even if space would be sufficient without
# left padding.
-SKIP_GROFF = badfont misalign
+SKIP_GROFF = font-eol misalign
.include <bsd.regress.mk>
-.\" $OpenBSD: badfont.in,v 1.2 2017/07/04 14:53:27 schwarze Exp $
-.TH TBL-MOD-BADFONT 1 "February 10, 2015"
+.\" $OpenBSD: badfont.in,v 1.3 2021/08/10 12:36:42 schwarze Exp $
+.TH TBL-MOD-BADFONT 1 "August 9, 2021"
.SH NAME
tbl-mod-badfont \- invalid font modifiers in table layouts
.SH DESCRIPTION
normal text
.TS
box tab(:);
-lfB lf
+lfI lfX
+lfB lfIB
lfI lf.
lfB lfI.
-bold:none
-italic:none
+italic:one char
+bold:two chars
+italic:dot
bold:italic
.TE
D\bDE\bES\bSC\bCR\bRI\bIP\bPT\bTI\bIO\bON\bN
normal text
- +----------------+
- |b\bbo\bol\bld\bd none |
- |_\bi_\bt_\ba_\bl_\bi_\bc none |
- |b\bbo\bol\bld\bd _\bi_\bt_\ba_\bl_\bi_\bc |
- +----------------+
-OpenBSD February 10, 2015 TBL-MOD-BADFONT(1)
+ +-------------------+
+ |_\bi_\bt_\ba_\bl_\bi_\bc one char |
+ |b\bbo\bol\bld\bd two chars |
+ |_\bi_\bt_\ba_\bl_\bi_\bc dot |
+ |b\bbo\bol\bld\bd _\bi_\bt_\ba_\bl_\bi_\bc |
+ +-------------------+
+OpenBSD August 9, 2021 TBL-MOD-BADFONT(1)
-mandoc: badfont.in:9:7: WARNING: unknown font, skipping request: TS f
-mandoc: badfont.in:10:7: WARNING: unknown font, skipping request: TS f.
+mandoc: badfont.in:9:7: WARNING: unknown font, skipping request: TS fX
+mandoc: badfont.in:10:7: WARNING: unknown font, skipping request: TS fIB
+mandoc: badfont.in:11:7: WARNING: unknown font, skipping request: TS f.
--- /dev/null
+.\" $OpenBSD: font-eol.in,v 1.1 2021/08/10 12:36:42 schwarze Exp $
+.TH TBL-MOD-FONT-EOL 1 "August 9, 2021"
+.SH NAME
+tbl-mod-font-eol \- font modifier at eol in table layout
+.SH DESCRIPTION
+normal text
+.TS
+box tab(:);
+lfB lf
+lfB lfI.
+bold:none
+bold:italic
+.TE
--- /dev/null
+TBL-MOD-FONT-EOL(1) General Commands Manual TBL-MOD-FONT-EOL(1)
+
+N\bNA\bAM\bME\bE
+ tbl-mod-font-eol - font modifier at eol in table layout
+
+D\bDE\bES\bSC\bCR\bRI\bIP\bPT\bTI\bIO\bON\bN
+ normal text
+
+ +--------------+
+ |b\bbo\bol\bld\bd none |
+ |b\bbo\bol\bld\bd _\bi_\bt_\ba_\bl_\bi_\bc |
+ +--------------+
+OpenBSD August 9, 2021 TBL-MOD-FONT-EOL(1)
--- /dev/null
+mandoc: font-eol.in:9:7: WARNING: unknown font, skipping request: TS f
-mandoc: font.in:9:6: WARNING: unknown font, skipping request: TS fCW|ci
mandoc: font.in:19:2: WARNING: tab in filled text
mandoc: font.in:19:4: WARNING: tab in filled text
mandoc: font.in:19:6: WARNING: tab in filled text
-/* $Id: roff.c,v 1.377 2021/06/27 17:57:55 schwarze Exp $ */
+/* $Id: roff.c,v 1.378 2021/08/10 12:55:04 schwarze Exp $ */
/*
* Copyright (c) 2010-2015, 2017-2020 Ingo Schwarze <schwarze@openbsd.org>
* Copyright (c) 2008-2012, 2014 Kristaps Dzonsons <kristaps@bsd.lv>
case ESCAPE_FONTITALIC:
case ESCAPE_FONTBOLD:
case ESCAPE_FONTBI:
- case ESCAPE_FONTCW:
+ case ESCAPE_FONTCR:
+ case ESCAPE_FONTCB:
+ case ESCAPE_FONTCI:
case ESCAPE_FONTPREV:
font++;
break;
cp = n->child->string;
switch (mandoc_font(cp, (int)strlen(cp))) {
case ESCAPE_FONTBOLD:
+ case ESCAPE_FONTCB:
term_fontrepl(p, TERMFONT_BOLD);
break;
case ESCAPE_FONTITALIC:
+ case ESCAPE_FONTCI:
term_fontrepl(p, TERMFONT_UNDER);
break;
case ESCAPE_FONTBI:
term_fontlast(p);
break;
case ESCAPE_FONTROMAN:
- case ESCAPE_FONTCW:
+ case ESCAPE_FONTCR:
term_fontrepl(p, TERMFONT_NONE);
break;
default:
-.\" $Id: tbl.7,v 1.34 2019/03/02 21:03:02 schwarze Exp $
+.\" $Id: tbl.7,v 1.35 2021/08/10 12:55:04 schwarze Exp $
.\"
.\" Copyright (c) 2010, 2011 Kristaps Dzonsons <kristaps@bsd.lv>
.\" Copyright (c) 2014,2015,2017,2018,2019 Ingo Schwarze <schwarze@openbsd.org>
.\" ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
.\" OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
.\"
-.Dd $Mdocdate: March 2 2019 $
+.Dd $Mdocdate: August 10 2021 $
.Dt TBL 7
.Os
.Sh NAME
.Cm e
modifier.
.It Cm f
-The next character selects the font to use for this cell.
+The next one or two characters select the font to use for this cell.
+One-character font names must be followed by a blank or period.
See the
.Xr roff 7
-manual for supported one-character font names.
+manual for supported font names.
.It Cm i
Use an italic font for the contents of this cell.
.It Cm m
-/* $Id: tbl.h,v 1.1 2018/12/12 21:54:35 schwarze Exp $ */
+/* $Id: tbl.h,v 1.2 2021/08/10 12:55:04 schwarze Exp $ */
/*
* Copyright (c) 2010, 2011 Kristaps Dzonsons <kristaps@bsd.lv>
- * Copyright (c) 2014, 2015, 2017, 2018 Ingo Schwarze <schwarze@openbsd.org>
+ * Copyright (c) 2014,2015,2017,2018,2021 Ingo Schwarze <schwarze@openbsd.org>
*
* Permission to use, copy, modify, and distribute this software for any
* purpose with or without fee is hereby granted, provided that the above
int vert; /* Width of subsequent vertical line. */
int col; /* Column number, starting from 0. */
int flags;
-#define TBL_CELL_BOLD (1 << 0) /* b, B, fB */
-#define TBL_CELL_ITALIC (1 << 1) /* i, I, fI */
#define TBL_CELL_TALIGN (1 << 2) /* t, T */
#define TBL_CELL_UP (1 << 3) /* u, U */
#define TBL_CELL_BALIGN (1 << 4) /* d, D */
#define TBL_CELL_WIGN (1 << 5) /* z, Z */
#define TBL_CELL_EQUAL (1 << 6) /* e, E */
#define TBL_CELL_WMAX (1 << 7) /* x, X */
+ enum mandoc_esc font;
enum tbl_cellt pos;
};
-/* $Id: tbl_data.c,v 1.55 2021/05/18 13:22:43 schwarze Exp $ */
+/* $Id: tbl_data.c,v 1.56 2021/08/10 12:55:04 schwarze Exp $ */
/*
* Copyright (c) 2009, 2010, 2011 Kristaps Dzonsons <kristaps@bsd.lv>
* Copyright (c) 2011,2015,2017-2019,2021 Ingo Schwarze <schwarze@openbsd.org>
if (dp->layout->last->col + 1 < dp->opts->cols) {
cp = mandoc_calloc(1, sizeof(*cp));
cp->pos = TBL_CELL_LEFT;
+ cp->font = ESCAPE_FONTROMAN;
cp->spacing = SIZE_MAX;
dp->layout->last->next = cp;
cp->col = dp->layout->last->col + 1;
-/* $Id: tbl_html.c,v 1.35 2021/05/16 23:18:35 schwarze Exp $ */
+/* $Id: tbl_html.c,v 1.36 2021/08/10 12:55:04 schwarze Exp $ */
/*
* Copyright (c) 2011 Kristaps Dzonsons <kristaps@bsd.lv>
* Copyright (c) 2014,2015,2017,2018,2021 Ingo Schwarze <schwarze@openbsd.org>
"border-right-style", rborder);
if (dp->string != NULL) {
save_font = h->metac;
- if (dp->layout->flags & TBL_CELL_BOLD)
- html_setfont(h, ESCAPE_FONTBOLD);
- else if (dp->layout->flags & TBL_CELL_ITALIC)
- html_setfont(h, ESCAPE_FONTITALIC);
+ html_setfont(h, dp->layout->font);
if (dp->layout->pos == TBL_CELL_LONG)
print_text(h, "\\[u2003]"); /* em space */
print_text(h, dp->string);
-/* $Id: tbl_layout.c,v 1.49 2020/09/01 18:25:28 schwarze Exp $ */
+/* $Id: tbl_layout.c,v 1.50 2021/08/10 12:55:04 schwarze Exp $ */
/*
* Copyright (c) 2009, 2010, 2011 Kristaps Dzonsons <kristaps@bsd.lv>
- * Copyright (c) 2012, 2014, 2015, 2017 Ingo Schwarze <schwarze@openbsd.org>
+ * Copyright (c) 2012, 2014, 2015, 2017, 2020, 2021
+ * Ingo Schwarze <schwarze@openbsd.org>
*
* Permission to use, copy, modify, and distribute this software for any
* purpose with or without fee is hereby granted, provided that the above
char *endptr;
unsigned long spacing;
size_t sz;
+ int isz;
+ enum mandoc_esc fontesc;
mod:
while (p[*pos] == ' ' || p[*pos] == '\t')
switch (tolower((unsigned char)p[(*pos)++])) {
case 'b':
- cp->flags |= TBL_CELL_BOLD;
+ cp->font = ESCAPE_FONTBOLD;
goto mod;
case 'd':
cp->flags |= TBL_CELL_BALIGN;
case 'f':
break;
case 'i':
- cp->flags |= TBL_CELL_ITALIC;
+ cp->font = ESCAPE_FONTITALIC;
goto mod;
case 'm':
mandoc_msg(MANDOCERR_TBLLAYOUT_MOD, ln, *pos, "m");
goto mod;
}
+ while (p[*pos] == ' ' || p[*pos] == '\t')
+ (*pos)++;
+
/* Ignore parenthised font names for now. */
if (p[*pos] == '(')
goto mod;
- /* Support only one-character font-names for now. */
-
- if (p[*pos] == '\0' || (p[*pos + 1] != ' ' && p[*pos + 1] != '.')) {
+ isz = 0;
+ if (p[*pos] != '\0')
+ isz++;
+ if (strchr(" \t.", p[*pos + isz]) == NULL)
+ isz++;
+
+ fontesc = mandoc_font(p + *pos, isz);
+
+ switch (fontesc) {
+ case ESCAPE_FONTPREV:
+ case ESCAPE_ERROR:
mandoc_msg(MANDOCERR_FT_BAD,
ln, *pos, "TS %s", p + *pos - 1);
- if (p[*pos] != '\0')
- (*pos)++;
- if (p[*pos] != '\0')
- (*pos)++;
- goto mod;
- }
-
- switch (p[(*pos)++]) {
- case '3':
- case 'B':
- cp->flags |= TBL_CELL_BOLD;
- goto mod;
- case '2':
- case 'I':
- cp->flags |= TBL_CELL_ITALIC;
- goto mod;
- case '1':
- case 'R':
- goto mod;
+ break;
default:
- mandoc_msg(MANDOCERR_FT_BAD,
- ln, *pos - 1, "TS f%c", p[*pos - 1]);
- goto mod;
+ cp->font = fontesc;
+ break;
}
+ *pos += isz;
+ goto mod;
}
static void
p = mandoc_calloc(1, sizeof(*p));
p->spacing = SIZE_MAX;
+ p->font = ESCAPE_FONTROMAN;
p->pos = pos;
if ((pp = rp->last) != NULL) {
-/* $Id: tbl_term.c,v 1.74 2020/10/25 18:28:23 schwarze Exp $ */
+/* $Id: tbl_term.c,v 1.75 2021/08/10 12:55:04 schwarze Exp $ */
/*
* Copyright (c) 2009, 2011 Kristaps Dzonsons <kristaps@bsd.lv>
- * Copyright (c) 2011-2020 Ingo Schwarze <schwarze@openbsd.org>
+ * Copyright (c) 2011-2021 Ingo Schwarze <schwarze@openbsd.org>
*
* Permission to use, copy, modify, and distribute this software for any
* purpose with or without fee is hereby granted, provided that the above
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);
-/* $Id: term.c,v 1.282 2020/09/02 16:40:36 schwarze Exp $ */
+/* $Id: term.c,v 1.283 2021/08/10 12:55:04 schwarze Exp $ */
/*
* Copyright (c) 2008, 2009, 2010, 2011 Kristaps Dzonsons <kristaps@bsd.lv>
* Copyright (c) 2010-2020 Ingo Schwarze <schwarze@openbsd.org>
uc = *seq;
break;
case ESCAPE_FONTBOLD:
+ case ESCAPE_FONTCB:
term_fontrepl(p, TERMFONT_BOLD);
continue;
case ESCAPE_FONTITALIC:
+ case ESCAPE_FONTCI:
term_fontrepl(p, TERMFONT_UNDER);
continue;
case ESCAPE_FONTBI:
term_fontrepl(p, TERMFONT_BI);
continue;
case ESCAPE_FONT:
- case ESCAPE_FONTCW:
+ case ESCAPE_FONTCR:
case ESCAPE_FONTROMAN:
term_fontrepl(p, TERMFONT_NONE);
continue;
-/* $Id: tree.c,v 1.89 2020/04/08 11:56:04 schwarze Exp $ */
+/* $Id: tree.c,v 1.90 2021/08/10 12:55:04 schwarze Exp $ */
/*
- * Copyright (c) 2013-2015, 2017-2020 Ingo Schwarze <schwarze@openbsd.org>
* Copyright (c) 2008, 2009, 2011, 2014 Kristaps Dzonsons <kristaps@bsd.lv>
+ * Copyright (c) 2013-2015, 2017-2021 Ingo Schwarze <schwarze@openbsd.org>
*
* Permission to use, copy, modify, and distribute this software for any
* purpose with or without fee is hereby granted, provided that the above
else {
printf("%d", cp->col);
print_cellt(dp->layout->pos);
- if (cp->flags & TBL_CELL_BOLD)
+ switch (cp->font) {
+ case ESCAPE_FONTBOLD:
putchar('b');
- if (cp->flags & TBL_CELL_ITALIC)
+ break;
+ case ESCAPE_FONTITALIC:
putchar('i');
+ break;
+ case ESCAPE_FONTBI:
+ fputs("bi", stdout);
+ break;
+ case ESCAPE_FONTCR:
+ putchar('c');
+ break;
+ case ESCAPE_FONTCB:
+ fputs("cb", stdout);
+ break;
+ case ESCAPE_FONTCI:
+ fputs("ci", stdout);
+ break;
+ default:
+ abort();
+ }
if (cp->flags & TBL_CELL_TALIGN)
putchar('t');
if (cp->flags & TBL_CELL_UP)