From 2c155e88b6e2ca5d3f75e9b16fcff86b8059f886 Mon Sep 17 00:00:00 2001 From: Ingo Schwarze Date: Tue, 10 Aug 2021 12:55:03 +0000 Subject: Support two-character font names (BI, CW, CR, CB, CI) 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. --- mandoc.h | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'mandoc.h') diff --git a/mandoc.h b/mandoc.h index 8f4895b2..ff76e71f 100644 --- a/mandoc.h +++ b/mandoc.h @@ -1,4 +1,4 @@ -/* $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 * Copyright (c) 2010, 2011, 2014 Kristaps Dzonsons @@ -291,7 +291,9 @@ enum mandoc_esc { 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 */ -- cgit v1.2.3-56-ge451