From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on inbox.vuxu.org X-Spam-Level: ** X-Spam-Status: No, score=2.7 required=5.0 tests=DKIM_INVALID,DKIM_SIGNED, FROM_SUSPICIOUS_NTLD,PDS_OTHER_BAD_TLD,T_TVD_MIME_EPI autolearn=no autolearn_force=no version=3.4.4 Received: (qmail 407 invoked from network); 8 Aug 2021 17:35:06 -0000 Received: from bsd.lv (HELO mandoc.bsd.lv) (66.111.2.12) by inbox.vuxu.org with ESMTPUTF8; 8 Aug 2021 17:35:06 -0000 Received: from fantadrom.bsd.lv (localhost [127.0.0.1]) by mandoc.bsd.lv (OpenSMTPD) with ESMTP id b8f1dce6 for ; Sun, 8 Aug 2021 12:35:03 -0500 (EST) Received: from tarta.nabijaczleweli.xyz (139-28-40-42.artus.net.pl [139.28.40.42]) by mandoc.bsd.lv (OpenSMTPD) with ESMTP id 88d1a432 for ; Sun, 8 Aug 2021 12:35:01 -0500 (EST) Received: from tarta.nabijaczleweli.xyz (unknown [192.168.1.250]) by tarta.nabijaczleweli.xyz (Postfix) with ESMTPSA id 90EB73602F7 for ; Sun, 8 Aug 2021 19:35:00 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=nabijaczleweli.xyz; s=202006; t=1628444100; bh=dX8mEg/lFjE/A6s/m3zlyBmOdyQlicGSaL/fNGJMVpQ=; h=Resent-From:Resent-Date:Resent-To:Date:From:To:Cc:Subject: References:In-Reply-To:From; b=W7+yg1AGZMDcRqJcqDCnJ1loT1AmCtb9c2VN3Q3NTNomMU9SJNGbCTanDwRhQtWRv E/345fWWmY+RzsV3SZopm03RTVO2C1lwkj8AJtN5CJqUkJCP/1o1zEVTF+r83N3HjV G4XNSk1vopxVfwN45qHL7Ut+cTePErtAwJUN1wGNykVRZliaDCOM0YLmorQDUSJqFd peN0ooYg55+ONMYXojTy1M8DPFbsD8OdVLn83B7V1pvMw4eUKIxy3pIzeNTVJWLhxB CDIdXjxgdWnLRx2QvkvrJiuoKMy7AC2ByGLHKHIYEeBeMbZhc7FfPA5JuO5OTKYmZk 2+HwyF7IUaBsg== Resent-From: =?utf-8?B?0L3QsNCx?= Resent-Date: Sun, 8 Aug 2021 19:34:59 +0200 Resent-Message-ID: <20210808173459.or7muynaqbyviiil@tarta.nabijaczleweli.xyz> Resent-To: tech@mandoc.bsd.lv Date: Sun, 8 Aug 2021 15:24:53 +0200 From: =?utf-8?B?0L3QsNCx?= To: tech@mandoc.bsd.lv Cc: 992002@bugs.debian.org Subject: [PATCH][Debian#992002] tbl: allow two-character fonts and format fonts in -Thtml Message-ID: <20210808132452.bekkztprjqoup3pa@tarta.nabijaczleweli.xyz> Mail-Followup-To: tech@mandoc.bsd.lv, 992002@bugs.debian.org References: <20210808111135.zisbfzlqqdsq35om@tarta.nabijaczleweli.xyz> <20210808124919.hevbw4gv6pis72pq@tarta.nabijaczleweli.xyz> X-Mailinglist: mandoc-tech Reply-To: tech@mandoc.bsd.lv MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha512; protocol="application/pgp-signature"; boundary="3kmafmretvzbsyhz" Content-Disposition: inline In-Reply-To: User-Agent: NeoMutt/20210205 --3kmafmretvzbsyhz Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable Hi! tbl's -Thtml ignores font requests; additionally, the tbl f-request parser only allows single-character fonts. Cf. the Debian bug (http://bugs.debian.org/992002) for additional context. Please consider the following patch. =D0=BD=D0=B0=D0=B1 --- With this patch, the following document: -- >8 -- =2EDd =2EDt V 1 =2EOs =2E \fBtext\fItext\f(BItext\f(CRtext\f(CBtext\f(CItext\fR =2EPp =2ETS lfB lfI lfBI lb li lbi lfCR lfCB lfCI . text text text text text text text text text =2ETE -- >8 -- Renders to a teletype with the expected fonts: b, ul, bul; b, ul, bul; normal, b, ul -Thtml -Ofragment yields, as expected: -- >8 --
V(1) General Commands Manual V(1)
texttexttexttexttexttext

text text text text text text text text text
August 8, 2021 Debian
-- >8 -- --- mdocml-1.14.5.orig/tbl.7 +++ mdocml-1.14.5/tbl.7 @@ -178,10 +178,11 @@ of any other column also having the .Cm e modifier. .It Cm f -The next character selects the font to use for this cell. +The next 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 --- mdocml-1.14.5.orig/tbl.h +++ mdocml-1.14.5/tbl.h @@ -59,12 +59,13 @@ struct tbl_cell { 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 */ +#define TBL_CELL_FONTCW (1 << 2) /* fC[RBI] */ +#define TBL_CELL_TALIGN (1 << 3) /* t, T */ +#define TBL_CELL_UP (1 << 4) /* u, U */ +#define TBL_CELL_BALIGN (1 << 5) /* d, D */ +#define TBL_CELL_WIGN (1 << 6) /* z, Z */ +#define TBL_CELL_EQUAL (1 << 7) /* e, E */ +#define TBL_CELL_WMAX (1 << 8) /* x, X */ enum tbl_cellt pos; }; =20 --- mdocml-1.14.5.orig/tbl_html.c +++ mdocml-1.14.5/tbl_html.c @@ -25,6 +25,7 @@ #include =20 #include "mandoc.h" +#include "mandoc_aux.h" #include "tbl.h" #include "out.h" #include "html.h" @@ -218,6 +219,7 @@ print_tbl(struct html *h, const struct t else valign =3D NULL; =20 + int flags =3D cp->flags; for (i =3D dp->hspans; i > 0; i--) cp =3D cp->next; switch (cp->vert) { @@ -239,8 +241,36 @@ print_tbl(struct html *h, const struct t "vertical-align", valign, "text-align", halign, "border-right-style", rborder); - if (dp->string !=3D NULL) - print_text(h, dp->string); + if (dp->string !=3D NULL) { + const char *font =3D NULL; + switch (flags & (TBL_CELL_BOLD | TBL_CELL_ITALIC | TBL_CELL_FONTCW)) { + case TBL_CELL_BOLD: + font =3D "\\fB"; + break; + case TBL_CELL_ITALIC: + font =3D "\\fI"; + break; + case TBL_CELL_BOLD | TBL_CELL_ITALIC: + font =3D "\\f(BI"; + break; + case TBL_CELL_FONTCW: + font =3D "\\f(CR"; + break; + case TBL_CELL_FONTCW | TBL_CELL_BOLD: + font =3D "\\f(CB"; + break; + case TBL_CELL_FONTCW | TBL_CELL_ITALIC: + font =3D "\\f(CI"; + break; + } + if (font) { + char *str; + mandoc_asprintf(&str, "%s%s\\fP", font, dp->string); + print_text(h, str); + free(str); + } else + print_text(h, dp->string); + } } =20 print_tagq(h, tt); --- mdocml-1.14.5.orig/tbl_layout.c +++ mdocml-1.14.5/tbl_layout.c @@ -170,9 +170,7 @@ mod: if (p[*pos] =3D=3D '(') goto mod; =20 - /* Support only one-character font-names for now. */ - - if (p[*pos] =3D=3D '\0' || (p[*pos + 1] !=3D ' ' && p[*pos + 1] !=3D '.')= ) { + if (p[*pos] =3D=3D '\0' || (!isalnum(p[*pos + 1]) && p[*pos + 1] !=3D ' '= && p[*pos + 1] !=3D '.')) { mandoc_msg(MANDOCERR_FT_BAD, ln, *pos, "TS %s", p + *pos - 1); if (p[*pos] !=3D '\0') @@ -182,23 +180,27 @@ mod: goto mod; } =20 - switch (p[(*pos)++]) { - case '3': - case 'B': + char fn[3] =3D {'\0'}, *fp =3D fn; + fn[0] =3D p[(*pos)++]; + fn[1] =3D p[*pos] =3D=3D ' ' || p[*pos] =3D=3D '.' ? '\0' : p[(*pos)++]; + +refont: + if (!strcmp(fp, "3") || !strcmp(fp, "B")) cp->flags |=3D TBL_CELL_BOLD; - goto mod; - case '2': - case 'I': + else if (!strcmp(fp, "2") || !strcmp(fp, "I")) cp->flags |=3D TBL_CELL_ITALIC; - goto mod; - case '1': - case 'R': - goto mod; - default: + else if (!strcmp(fp, "1") || !strcmp(fp, "R")) + ; + else if (!strcmp(fp, "BI")) + cp->flags |=3D TBL_CELL_BOLD | TBL_CELL_ITALIC; + else if (fp[0] =3D=3D 'C' && fp[1]) { + cp->flags |=3D TBL_CELL_FONTCW; + ++fp; + goto refont; + } else mandoc_msg(MANDOCERR_FT_BAD, - ln, *pos - 1, "TS f%c", p[*pos - 1]); - goto mod; - } + ln, *pos - strlen(fn), "TS f%s", fn); + goto mod; } =20 static void --- mdocml-1.14.5.orig/tbl_term.c +++ mdocml-1.14.5/tbl_term.c @@ -922,10 +922,17 @@ tbl_word(struct termp *tp, const struct int prev_font; =20 prev_font =3D 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->flags & (TBL_CELL_BOLD | TBL_CELL_ITALIC)) { + case TBL_CELL_BOLD | TBL_CELL_ITALIC: + term_fontpush(tp, TERMFONT_BI); + break; + case TBL_CELL_BOLD: + term_fontpush(tp, TERMFONT_BOLD); + break; + case TBL_CELL_ITALIC: + term_fontpush(tp, TERMFONT_UNDER); + break; + } =20 term_word(tp, dp->string); =20 --3kmafmretvzbsyhz Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQIzBAABCgAdFiEEfWlHToQCjFzAxEFjvP0LAY0mWPEFAmEP2yEACgkQvP0LAY0m WPHPbRAAo5LsmKxXYS2SJAqHI2A82RBn9o21knOainGn1P6dUOk7eyHvA3NBZPQb RsXKA+6BaCjfKWGkB1jJvT42XCqbaTODwx0q9rTj6QwCSB0PulHDH7IlvKjjpyi1 xPG9Kg9wpoQnJVCU1o9cWCW/j2ZEuXy6oneVKpI1ldesKK8LPBi0KdUGyqUmdscL o4RnjHQBTryR3HIENTx4B3qIt2KFjUC1tnvVIG+QiULdSqu81jg/5u8tgUwOA2Pk tCAytbncWbmXHny9z97Vrd1sXjC6e+i9y2GegR8kenfrPZG0V5h664GAtOZHofuJ OOeBrivc7DBXOBuxq6dfuOfSwqScSvELjBu005ORKUrZ3C7dSuA3rXUFQCbTLLEc cRIgYTb16aoErmrLC9Pi/XfP64epbCVKNXQPs2Jyzf1QQ2bgwtOyicP/HRSQ5iBv DxHNBIPUuOCU+D6weaTeRFWp9DAYYs28eFMOw+QchAGupmwnNvtr5nE9wEYbfocf JWMvr9+NmAErcfEW8JdzZg3AyKvJUZecxDz9rL7XRD1yDOac76sqQzWiJL/57tK1 i5ozMoKlIBgw0oU9rMcihXw9b7F/GP24afKrMh8Ix+O1mK7AjwecOW80GWfkcpMB hyJoY31IdPurt7D6dOjUIqK/dW9olhMw7z32aadhVSSa1YnbpKs= =aHdU -----END PGP SIGNATURE----- --3kmafmretvzbsyhz-- -- To unsubscribe send an email to tech+unsubscribe@mandoc.bsd.lv From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on inbox.vuxu.org X-Spam-Level: X-Spam-Status: No, score=0.0 required=5.0 tests=UNPARSEABLE_RELAY autolearn=ham autolearn_force=no version=3.4.4 Received: (qmail 5435 invoked from network); 9 Aug 2021 08:58:31 -0000 Received: from bsd.lv (HELO mandoc.bsd.lv) (66.111.2.12) by inbox.vuxu.org with ESMTPUTF8; 9 Aug 2021 08:58:31 -0000 Received: from fantadrom.bsd.lv (localhost [127.0.0.1]) by mandoc.bsd.lv (OpenSMTPD) with ESMTP id 01207fbf for ; Mon, 9 Aug 2021 03:58:29 -0500 (EST) Received: from scc-mailout-kit-01.scc.kit.edu (scc-mailout-kit-01.scc.kit.edu [129.13.231.81]) by mandoc.bsd.lv (OpenSMTPD) with ESMTP id 5f98bc07 for ; Mon, 9 Aug 2021 03:58:22 -0500 (EST) Received: from hekate.asta.kit.edu ([141.3.145.153] helo=hekate.usta.de) by scc-mailout-kit-01.scc.kit.edu with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (envelope-from ) id 1mD16y-0002Sd-NY; Mon, 09 Aug 2021 10:58:21 +0200 Received: from donnerwolke.asta.kit.edu ([141.3.145.61] helo=donnerwolke.usta.de) by hekate.usta.de with esmtp (Exim 4.92.2) (envelope-from ) id 1mD16x-0000Ld-FB; Mon, 09 Aug 2021 10:58:19 +0200 Received: from athene.asta.kit.edu ([141.3.145.60] helo=athene.usta.de) by donnerwolke.usta.de with esmtp (Exim 4.84_2) (envelope-from ) id 1mD16x-0006DT-A3; Mon, 09 Aug 2021 10:58:19 +0200 Received: from localhost (athene.usta.de [local]) by athene.usta.de (OpenSMTPD) with ESMTPA id 6b7a415a; Mon, 9 Aug 2021 10:58:19 +0200 (CEST) Date: Mon, 9 Aug 2021 10:58:19 +0200 From: Ingo Schwarze To: nabijaczleweli@nabijaczleweli.xyz Cc: tech@mandoc.bsd.lv, 992002@bugs.debian.org Subject: Re: [PATCH][Debian#992002] tbl: allow two-character fonts and format fonts in -Thtml Message-ID: <20210809085819.GA81032@athene.usta.de> References: <20210808111135.zisbfzlqqdsq35om@tarta.nabijaczleweli.xyz> <20210808124919.hevbw4gv6pis72pq@tarta.nabijaczleweli.xyz> <20210808132452.bekkztprjqoup3pa@tarta.nabijaczleweli.xyz> X-Mailinglist: mandoc-tech Reply-To: tech@mandoc.bsd.lv MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable In-Reply-To: <20210808132452.bekkztprjqoup3pa@tarta.nabijaczleweli.xyz> User-Agent: Mutt/1.12.2 (2019-09-21) Hello Nab, Nab wrote on Sun, Aug 08, 2021 at 03:24:53PM +0200: > tbl's -Thtml ignores font requests; Not in CVS HEAD; see https://cvsweb.bsd.lv/mandoc/tbl_html.c revision 1.34, committed on May 16 earlier this year. > additionally, the tbl f-request > parser only allows single-character fonts. Yes, that is still a missing feature. > Cf. the Debian bug > (http://bugs.debian.org/992002) for additional context. >=20 > Please consider the following patch. Thank you very much for sending quite a non-trivial patch. That was very helpful in understanding what exactly is needed. I started from your patch and changed a few aspects: * You couldn't possibly know that i'm trying to work towards a unified system for identifying fonts using the mandoc.h enum mandoc_esc ESCAPE_FONT* identifiers. Having different font identifiers for each output module is not good. So i added ESCAPE_FONTCB and ESCAPE_FONTCI and used those. A nice side effect is that CB and CI now work in HTML for all of \f, .ft, and tbl(7) f and that tbl(7) fBI now also works for terminal output. * GNU tbl(1) appears to ignore space characters between the f modifier and the font name, so "lf B" is the same as "lfB". > With this patch, the following document: > -- >8 -- > .Dd > .Dt V 1 > .Os > . > \fBtext\fItext\f(BItext\f(CRtext\f(CBtext\f(CItext\fR > .Pp > .TS > lfB lfI lfBI lb li lbi lfCR lfCB lfCI . > text text text text text text text text text > .TE > -- >8 -- >=20 > Renders to a teletype with the expected fonts: > b, ul, bul; b, ul, bul; normal, b, ul Not quite. The expected output for lbi is ul, not bul. The i overrides the b rather than add to it. So lbi is the same as lfI, not as lfBI. > -Thtml -Ofragment yields, as expected: > -- >8 -- [...] > > > > > > > > Again, with my version of the patch. > > > These become: Could you please check out from CVS (instead of the last release), apply the following patch, and tell me whether it looks reasonable and works for you? When this gets committed, i will credit you for reporting the missing feature. Do i understand correctly that "Nabija" is your first name and "Czleweli" your last name? Thanks again, Ingo --=20 Ingo Schwarze http://www.openbsd.org/ http://mandoc.bsd.lv/ Index: html.c =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D RCS file: /home/cvs/mandoc/mandoc/html.c,v retrieving revision 1.273 diff -u -p -r1.273 html.c --- html.c 2 Jun 2021 17:51:38 -0000 1.273 +++ html.c 9 Aug 2021 07:50:02 -0000 @@ -1,7 +1,7 @@ /* $Id: html.c,v 1.273 2021/06/02 17:51:38 schwarze Exp $ */ /* - * Copyright (c) 2011-2015, 2017-2020 Ingo Schwarze * Copyright (c) 2008-2011, 2014 Kristaps Dzonsons + * Copyright (c) 2011-2015, 2017-2021 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 @@ -240,8 +240,10 @@ html_setfont(struct html *h, enum mandoc 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 =3D ESCAPE_FONTROMAN; @@ -272,9 +274,17 @@ print_metaf(struct html *h) h->metaf =3D print_otag(h, TAG_B, ""); print_otag(h, TAG_I, ""); break; - case ESCAPE_FONTCW: + case ESCAPE_FONTCR: h->metaf =3D print_otag(h, TAG_SPAN, "c", "Li"); break; + case ESCAPE_FONTCB: + h->metaf =3D print_otag(h, TAG_SPAN, "c", "Li"); + print_otag(h, TAG_B, ""); + break; + case ESCAPE_FONTCI: + h->metaf =3D print_otag(h, TAG_SPAN, "c", "Li"); + print_otag(h, TAG_I, ""); + break; default: break; } @@ -503,8 +513,10 @@ print_encode(struct html *h, const char=20 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 =3D=3D norecurse) { h->flags |=3D HTML_NOSPACE; if (html_setfont(h, esc)) Index: man_validate.c =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D RCS file: /home/cvs/mandoc/mandoc/man_validate.c,v retrieving revision 1.155 diff -u -p -r1.155 man_validate.c --- man_validate.c 30 Oct 2020 13:24:33 -0000 1.155 +++ man_validate.c 9 Aug 2021 07:50:02 -0000 @@ -239,7 +239,9 @@ check_tag(struct roff_node *n, struct ro 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; Index: mandoc.c =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D RCS file: /home/cvs/mandoc/mandoc/mandoc.c,v retrieving revision 1.118 diff -u -p -r1.118 mandoc.c --- mandoc.c 24 Oct 2020 22:57:39 -0000 1.118 +++ mandoc.c 9 Aug 2021 07:50:02 -0000 @@ -1,7 +1,7 @@ /* $Id: mandoc.c,v 1.118 2020/10/24 22:57:39 schwarze Exp $ */ /* * Copyright (c) 2008-2011, 2014 Kristaps Dzonsons - * Copyright (c) 2011-2015, 2017-2020 Ingo Schwarze + * Copyright (c) 2011-2015, 2017-2021 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 @@ -74,12 +74,12 @@ mandoc_font(const char *cp, int sz) 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; } Index: mandoc.h =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D RCS file: /home/cvs/mandoc/mandoc/mandoc.h,v retrieving revision 1.272 diff -u -p -r1.272 mandoc.h --- mandoc.h 4 Jul 2021 15:38:26 -0000 1.272 +++ mandoc.h 9 Aug 2021 07:50:02 -0000 @@ -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 */ Index: mandoc_headers.3 =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D RCS file: /home/cvs/mandoc/mandoc/mandoc_headers.3,v retrieving revision 1.33 diff -u -p -r1.33 mandoc_headers.3 --- mandoc_headers.3 13 Mar 2020 15:32:28 -0000 1.33 +++ mandoc_headers.3 9 Aug 2021 07:50:02 -0000 @@ -1,6 +1,6 @@ .\" $Id: mandoc_headers.3,v 1.33 2020/03/13 15:32:28 schwarze Exp $ .\" -.\" Copyright (c) 2014-2020 Ingo Schwarze +.\" Copyright (c) 2014-2021 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 @@ -167,7 +167,11 @@ parse tree; can be used everywhere. 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 , Index: mdoc_markdown.c =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D RCS file: /home/cvs/mandoc/mandoc/mdoc_markdown.c,v retrieving revision 1.36 diff -u -p -r1.36 mdoc_markdown.c --- mdoc_markdown.c 22 Jun 2020 19:20:40 -0000 1.36 +++ mdoc_markdown.c 9 Aug 2021 07:50:02 -0000 @@ -603,16 +603,18 @@ md_word(const char *s) md_rawword("markdown"); continue; case ESCAPE_FONTBOLD: + case ESCAPE_FONTCB: nextfont =3D "**"; break; case ESCAPE_FONTITALIC: + case ESCAPE_FONTCI: nextfont =3D "*"; break; case ESCAPE_FONTBI: nextfont =3D "***"; break; case ESCAPE_FONT: - case ESCAPE_FONTCW: + case ESCAPE_FONTCR: case ESCAPE_FONTROMAN: nextfont =3D ""; break; Index: out.c =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D RCS file: /home/cvs/mandoc/mandoc/out.c,v retrieving revision 1.79 diff -u -p -r1.79 out.c --- out.c 31 Dec 2019 22:58:41 -0000 1.79 +++ out.c 9 Aug 2021 07:50:02 -0000 @@ -22,11 +22,13 @@ #include #include #include +#include #include #include #include =20 #include "mandoc_aux.h" +#include "mandoc.h" #include "tbl.h" #include "out.h" =20 Index: roff.c =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D RCS file: /home/cvs/mandoc/mandoc/roff.c,v retrieving revision 1.377 diff -u -p -r1.377 roff.c --- roff.c 27 Jun 2021 17:57:55 -0000 1.377 +++ roff.c 9 Aug 2021 07:50:03 -0000 @@ -3667,7 +3667,9 @@ roff_char(ROFF_ARGS) 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; Index: roff_term.c =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D RCS file: /home/cvs/mandoc/mandoc/roff_term.c,v retrieving revision 1.22 diff -u -p -r1.22 roff_term.c --- roff_term.c 3 Sep 2020 20:43:15 -0000 1.22 +++ roff_term.c 9 Aug 2021 07:50:03 -0000 @@ -112,9 +112,11 @@ roff_term_pre_ft(ROFF_TERM_ARGS) cp =3D 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: @@ -124,7 +126,7 @@ roff_term_pre_ft(ROFF_TERM_ARGS) term_fontlast(p); break; case ESCAPE_FONTROMAN: - case ESCAPE_FONTCW: + case ESCAPE_FONTCR: term_fontrepl(p, TERMFONT_NONE); break; default: Index: tbl.7 =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D RCS file: /home/cvs/mandoc/mandoc/tbl.7,v retrieving revision 1.34 diff -u -p -r1.34 tbl.7 --- tbl.7 2 Mar 2019 21:03:02 -0000 1.34 +++ tbl.7 9 Aug 2021 07:50:03 -0000 @@ -178,10 +178,11 @@ of any other column also having the .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 Index: tbl.h =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D RCS file: /home/cvs/mandoc/mandoc/tbl.h,v retrieving revision 1.1 diff -u -p -r1.1 tbl.h --- tbl.h 12 Dec 2018 21:54:35 -0000 1.1 +++ tbl.h 9 Aug 2021 07:50:03 -0000 @@ -1,7 +1,7 @@ /* $Id: tbl.h,v 1.1 2018/12/12 21:54:35 schwarze Exp $ */ /* * Copyright (c) 2010, 2011 Kristaps Dzonsons - * Copyright (c) 2014, 2015, 2017, 2018 Ingo Schwarze + * Copyright (c) 2014,2015,2017,2018,2021 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 @@ -57,14 +57,13 @@ struct tbl_cell { 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; }; =20 Index: tbl_data.c =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D RCS file: /home/cvs/mandoc/mandoc/tbl_data.c,v retrieving revision 1.55 diff -u -p -r1.55 tbl_data.c --- tbl_data.c 18 May 2021 13:22:43 -0000 1.55 +++ tbl_data.c 9 Aug 2021 07:50:03 -0000 @@ -78,6 +78,7 @@ getdata(struct tbl_node *tbl, struct tbl if (dp->layout->last->col + 1 < dp->opts->cols) { cp =3D mandoc_calloc(1, sizeof(*cp)); cp->pos =3D TBL_CELL_LEFT; + cp->font =3D ESCAPE_FONTROMAN; cp->spacing =3D SIZE_MAX; dp->layout->last->next =3D cp; cp->col =3D dp->layout->last->col + 1; Index: tbl_html.c =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D RCS file: /home/cvs/mandoc/mandoc/tbl_html.c,v retrieving revision 1.35 diff -u -p -r1.35 tbl_html.c --- tbl_html.c 16 May 2021 23:18:35 -0000 1.35 +++ tbl_html.c 9 Aug 2021 07:50:03 -0000 @@ -243,10 +243,7 @@ print_tbl(struct html *h, const struct t "border-right-style", rborder); if (dp->string !=3D NULL) { save_font =3D 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 =3D=3D TBL_CELL_LONG) print_text(h, "\\[u2003]"); /* em space */ print_text(h, dp->string); Index: tbl_layout.c =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D RCS file: /home/cvs/mandoc/mandoc/tbl_layout.c,v retrieving revision 1.49 diff -u -p -r1.49 tbl_layout.c --- tbl_layout.c 1 Sep 2020 18:25:28 -0000 1.49 +++ tbl_layout.c 9 Aug 2021 07:50:03 -0000 @@ -1,7 +1,8 @@ /* $Id: tbl_layout.c,v 1.49 2020/09/01 18:25:28 schwarze Exp $ */ /* * Copyright (c) 2009, 2010, 2011 Kristaps Dzonsons - * Copyright (c) 2012, 2014, 2015, 2017 Ingo Schwarze + * Copyright (c) 2012, 2014, 2015, 2017, 2020, 2021 + * 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 @@ -67,6 +68,8 @@ mods(struct tbl_node *tbl, struct tbl_ce char *endptr; unsigned long spacing; size_t sz; + int isz; + enum mandoc_esc fontesc; =20 mod: while (p[*pos] =3D=3D ' ' || p[*pos] =3D=3D '\t') @@ -105,7 +108,7 @@ mod: =20 switch (tolower((unsigned char)p[(*pos)++])) { case 'b': - cp->flags |=3D TBL_CELL_BOLD; + cp->font =3D ESCAPE_FONTBOLD; goto mod; case 'd': cp->flags |=3D TBL_CELL_BALIGN; @@ -116,7 +119,7 @@ mod: case 'f': break; case 'i': - cp->flags |=3D TBL_CELL_ITALIC; + cp->font =3D ESCAPE_FONTITALIC; goto mod; case 'm': mandoc_msg(MANDOCERR_TBLLAYOUT_MOD, ln, *pos, "m"); @@ -170,40 +173,34 @@ mod: goto mod; } =20 + while (p[*pos] =3D=3D ' ') + (*pos)++; + /* Ignore parenthised font names for now. */ =20 if (p[*pos] =3D=3D '(') goto mod; =20 - /* Support only one-character font-names for now. */ - - if (p[*pos] =3D=3D '\0' || (p[*pos + 1] !=3D ' ' && p[*pos + 1] !=3D '.')= ) { + isz =3D 0; + if (p[*pos] !=3D '\0') + isz++; + if (strchr(" .", p[*pos + isz]) =3D=3D NULL) + isz++; +=09 + fontesc =3D 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] !=3D '\0') - (*pos)++; - if (p[*pos] !=3D '\0') - (*pos)++; - goto mod; - } - - switch (p[(*pos)++]) { - case '3': - case 'B': - cp->flags |=3D TBL_CELL_BOLD; - goto mod; - case '2': - case 'I': - cp->flags |=3D 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 =3D fontesc; + break; } + *pos +=3D isz; + goto mod; } =20 static void @@ -362,6 +359,7 @@ cell_alloc(struct tbl_node *tbl, struct=20 =20 p =3D mandoc_calloc(1, sizeof(*p)); p->spacing =3D SIZE_MAX; + p->font =3D ESCAPE_FONTROMAN; p->pos =3D pos; =20 if ((pp =3D rp->last) !=3D NULL) { Index: tbl_term.c =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D RCS file: /home/cvs/mandoc/mandoc/tbl_term.c,v retrieving revision 1.74 diff -u -p -r1.74 tbl_term.c --- tbl_term.c 25 Oct 2020 18:28:23 -0000 1.74 +++ tbl_term.c 9 Aug 2021 07:50:03 -0000 @@ -1,7 +1,7 @@ /* $Id: tbl_term.c,v 1.74 2020/10/25 18:28:23 schwarze Exp $ */ /* * Copyright (c) 2009, 2011 Kristaps Dzonsons - * Copyright (c) 2011-2020 Ingo Schwarze + * Copyright (c) 2011-2021 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 @@ -923,10 +923,24 @@ tbl_word(struct termp *tp, const struct=20 int prev_font; =20 prev_font =3D 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(); + } =20 term_word(tp, dp->string); =20 Index: term.c =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D RCS file: /home/cvs/mandoc/mandoc/term.c,v retrieving revision 1.282 diff -u -p -r1.282 term.c --- term.c 2 Sep 2020 16:40:36 -0000 1.282 +++ term.c 9 Aug 2021 07:50:03 -0000 @@ -589,16 +589,18 @@ term_word(struct termp *p, const char *w uc =3D *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; Index: tree.c =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D RCS file: /home/cvs/mandoc/mandoc/tree.c,v retrieving revision 1.89 diff -u -p -r1.89 tree.c --- tree.c 8 Apr 2020 11:56:04 -0000 1.89 +++ tree.c 9 Aug 2021 07:50:03 -0000 @@ -1,7 +1,7 @@ /* $Id: tree.c,v 1.89 2020/04/08 11:56:04 schwarze Exp $ */ /* - * Copyright (c) 2013-2015, 2017-2020 Ingo Schwarze * Copyright (c) 2008, 2009, 2011, 2014 Kristaps Dzonsons + * Copyright (c) 2013-2015, 2017-2021 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 @@ -471,10 +471,28 @@ print_span(const struct tbl_span *sp, in 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) Index: regress/roff/esc/f.out_html =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D RCS file: /home/cvs/mandoc/mandoc/regress/roff/esc/f.out_html,v retrieving revision 1.2 diff -u -p -r1.2 f.out_html --- regress/roff/esc/f.out_html 3 Sep 2019 18:19:51 -0000 1.2 +++ regress/roff/esc/f.out_html 9 Aug 2021 07:50:04 -0000 @@ -1,4 +1,4 @@ numbers: bolditalicbolditalicroman letters: bolditalicbackbolditalicroman multiletter: boldemptyitalicbackbolditalicroman -typewriter: romanboldr= omanitalicroman +typewriter: romanbold<= /span>romanitalicroman Index: regress/roff/ft/badargs.out_html =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D RCS file: /home/cvs/mandoc/mandoc/regress/roff/ft/badargs.out_html,v retrieving revision 1.4 diff -u -p -r1.4 badargs.out_html --- regress/roff/ft/badargs.out_html 3 Sep 2019 18:19:52 -0000 1.4 +++ regress/roff/ft/badargs.out_html 9 Aug 2021 07:50:04 -0000 @@ -1,6 +1,7 @@
default font italic bold italic - typeqriter roman <= b>bold - italic bold still bold italic back to - bold back to italic + typeqriter roman + bold italic= + bold still bold italic back to bold bac= k to + italic
Index: regress/tbl/mod/Makefile =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D RCS file: /home/cvs/mandoc/mandoc/regress/tbl/mod/Makefile,v retrieving revision 1.4 diff -u -p -r1.4 Makefile --- regress/tbl/mod/Makefile 27 Jun 2017 19:51:48 -0000 1.4 +++ regress/tbl/mod/Makefile 9 Aug 2021 07:50:04 -0000 @@ -1,15 +1,16 @@ # $OpenBSD: Makefile,v 1.2 2015/02/10 11:02:19 schwarze Exp $ =20 -REGRESS_TARGETS =3D badfont expand expand-toowide font misalign spacing w= idth -LINT_TARGETS =3D badfont font +REGRESS_TARGETS =3D badfont expand expand-toowide font font-eol +REGRESS_TARGETS +=3D misalign spacing width +LINT_TARGETS =3D badfont font font-eol =20 -# 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. =20 -SKIP_GROFF =3D badfont misalign +SKIP_GROFF =3D font-eol misalign =20 .include Index: regress/tbl/mod/badfont.in =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D RCS file: /home/cvs/mandoc/mandoc/regress/tbl/mod/badfont.in,v retrieving revision 1.2 diff -u -p -r1.2 badfont.in --- regress/tbl/mod/badfont.in 4 Jul 2017 15:26:56 -0000 1.2 +++ regress/tbl/mod/badfont.in 9 Aug 2021 07:50:04 -0000 @@ -1,15 +1,17 @@ .\" $OpenBSD: badfont.in,v 1.2 2017/07/04 14:53:27 schwarze Exp $ -.TH TBL-MOD-BADFONT 1 "February 10, 2015" +.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 Index: regress/tbl/mod/badfont.out_ascii =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D RCS file: /home/cvs/mandoc/mandoc/regress/tbl/mod/badfont.out_ascii,v retrieving revision 1.2 diff -u -p -r1.2 badfont.out_ascii --- regress/tbl/mod/badfont.out_ascii 28 Jun 2021 20:13:08 -0000 1.2 +++ regress/tbl/mod/badfont.out_ascii 9 Aug 2021 07:50:04 -0000 @@ -6,9 +6,10 @@ N=08NA=08AM=08ME=08E D=08DE=08ES=08SC=08CR=08RI=08IP=08PT=08TI=08IO=08ON=08N normal text =20 - +----------------+ - |b=08bo=08ol=08ld=08d none | - |_=08i_=08t_=08a_=08l_=08i_=08c none | - |b=08bo=08ol=08ld=08d _=08i_=08t_=08a_=08l_=08i_=08c | - +----------------+ -OpenBSD February 10, 2015 TBL-MOD-BADFON= T(1) + +-------------------+ + |_=08i_=08t_=08a_=08l_=08i_=08c one char | + |b=08bo=08ol=08ld=08d two chars | + |_=08i_=08t_=08a_=08l_=08i_=08c dot | + |b=08bo=08ol=08ld=08d _=08i_=08t_=08a_=08l_=08i_=08c | + +-------------------+ +OpenBSD August 9, 2021 TBL-MOD-BADFON= T(1) Index: regress/tbl/mod/badfont.out_lint =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D RCS file: /home/cvs/mandoc/mandoc/regress/tbl/mod/badfont.out_lint,v retrieving revision 1.4 diff -u -p -r1.4 badfont.out_lint --- regress/tbl/mod/badfont.out_lint 4 Jul 2017 15:26:56 -0000 1.4 +++ regress/tbl/mod/badfont.out_lint 9 Aug 2021 07:50:04 -0000 @@ -1,2 +1,3 @@ -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. Index: regress/tbl/mod/font-eol.in =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D RCS file: regress/tbl/mod/font-eol.in diff -N regress/tbl/mod/font-eol.in --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ regress/tbl/mod/font-eol.in 9 Aug 2021 07:50:04 -0000 @@ -0,0 +1,13 @@ +.\" $OpenBSD: badfont.in,v 1.2 2017/07/04 14:53:27 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 Index: regress/tbl/mod/font-eol.out_ascii =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D RCS file: regress/tbl/mod/font-eol.out_ascii diff -N regress/tbl/mod/font-eol.out_ascii --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ regress/tbl/mod/font-eol.out_ascii 9 Aug 2021 07:50:04 -0000 @@ -0,0 +1,13 @@ +TBL-MOD-FONT-EOL(1) General Commands Manual TBL-MOD-FONT-EO= L(1) + +N=08NA=08AM=08ME=08E + tbl-mod-font-eol - font modifier at eol in table layout + +D=08DE=08ES=08SC=08CR=08RI=08IP=08PT=08TI=08IO=08ON=08N + normal text + + +--------------+ + |b=08bo=08ol=08ld=08d none | + |b=08bo=08ol=08ld=08d _=08i_=08t_=08a_=08l_=08i_=08c | + +--------------+ +OpenBSD August 9, 2021 TBL-MOD-FONT-EO= L(1) Index: regress/tbl/mod/font-eol.out_lint =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D RCS file: regress/tbl/mod/font-eol.out_lint diff -N regress/tbl/mod/font-eol.out_lint --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ regress/tbl/mod/font-eol.out_lint 9 Aug 2021 07:50:04 -0000 @@ -0,0 +1 @@ +mandoc: font-eol.in:9:7: WARNING: unknown font, skipping request: TS f Index: regress/tbl/mod/font.out_lint =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D RCS file: /home/cvs/mandoc/mandoc/regress/tbl/mod/font.out_lint,v retrieving revision 1.5 diff -u -p -r1.5 font.out_lint --- regress/tbl/mod/font.out_lint 4 Jul 2017 15:26:56 -0000 1.5 +++ regress/tbl/mod/font.out_lint 9 Aug 2021 07:50:04 -0000 @@ -1,4 +1,3 @@ -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 -- To unsubscribe send an email to tech+unsubscribe@mandoc.bsd.lv From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on inbox.vuxu.org X-Spam-Level: ** X-Spam-Status: No, score=2.7 required=5.0 tests=DKIM_INVALID,DKIM_SIGNED, FROM_SUSPICIOUS_NTLD,PDS_OTHER_BAD_TLD,T_TVD_MIME_EPI autolearn=no autolearn_force=no version=3.4.4 Received: (qmail 6516 invoked from network); 9 Aug 2021 23:08:38 -0000 Received: from bsd.lv (HELO mandoc.bsd.lv) (66.111.2.12) by inbox.vuxu.org with ESMTPUTF8; 9 Aug 2021 23:08:38 -0000 Received: from fantadrom.bsd.lv (localhost [127.0.0.1]) by mandoc.bsd.lv (OpenSMTPD) with ESMTP id 40f5380f for ; Mon, 9 Aug 2021 18:08:35 -0500 (EST) Received: from tarta.nabijaczleweli.xyz (139-28-40-42.artus.net.pl [139.28.40.42]) by mandoc.bsd.lv (OpenSMTPD) with ESMTP id 7aa76528 for ; Mon, 9 Aug 2021 18:08:35 -0500 (EST) Received: from tarta.nabijaczleweli.xyz (unknown [192.168.1.250]) by tarta.nabijaczleweli.xyz (Postfix) with ESMTPSA id EF43E360ED0; Tue, 10 Aug 2021 01:08:32 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=nabijaczleweli.xyz; s=202006; t=1628550513; bh=AFE2P2CUrSKo1oFKCGKB1JBczsaNp3szqcSn2phlb2w=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=utFqR5JU2pJrkwV2njdg0WwzM2iw0FVfy99drwhchax29z/+XCnBdtD+r3Ceh5XYZ Bdvj1nNxXV9KlLD5p7UmDJAbb9DI5Qj+tOH6v5HXUMaDu+i7gW0g+zRMQ9KQByHY7W E2eq9n7Xneh5SkDNH7r9kTPgkraAnUcM+NLLVBwZMoZBw+qsHHcRWbmzf578lHQ7rU m2bWqlmcirNlTqN9/bx7LIjq2uJB2dOR24lEiMvI9mY/laMXfoaXmKbt8tJCnsnFdc AsSczvoclLlf0405xUDmwuFFcO8OeoJCvlfJ33hgtvnS6XNJu6c8jYtnQ6Ua+LsyPs s4TMWmyCCIdOg== Date: Tue, 10 Aug 2021 01:08:31 +0200 From: =?utf-8?B?0L3QsNCx?= To: Ingo Schwarze Cc: tech@mandoc.bsd.lv, 992002@bugs.debian.org Subject: Re: [PATCH][Debian#992002] tbl: allow two-character fonts and format fonts in -Thtml Message-ID: <20210809230831.7lwnchffsqds42ax@tarta.nabijaczleweli.xyz> Mail-Followup-To: Ingo Schwarze , tech@mandoc.bsd.lv, 992002@bugs.debian.org References: <20210808111135.zisbfzlqqdsq35om@tarta.nabijaczleweli.xyz> <20210808124919.hevbw4gv6pis72pq@tarta.nabijaczleweli.xyz> <20210808132452.bekkztprjqoup3pa@tarta.nabijaczleweli.xyz> <20210809085819.GA81032@athene.usta.de> X-Mailinglist: mandoc-tech Reply-To: tech@mandoc.bsd.lv MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha512; protocol="application/pgp-signature"; boundary="cx7lt76colzzicyr" Content-Disposition: inline In-Reply-To: <20210809085819.GA81032@athene.usta.de> User-Agent: NeoMutt/20210205 --cx7lt76colzzicyr Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Mon, Aug 09, 2021 at 10:58:19AM +0200, Ingo Schwarze wrote: > Nab wrote on Sun, Aug 08, 2021 at 03:24:53PM +0200: > > tbl's -Thtml ignores font requests; > Not in CVS HEAD; see https://cvsweb.bsd.lv/mandoc/tbl_html.c revision 1.3= 4, > committed on May 16 earlier this year. Oh, indeed. I tested and based my patch on 1.14.5 from Debian, didn't realise that's almost two years old by now. Will use the CVS next time. > I started from your patch and changed a few aspects: > * You couldn't possibly know that i'm trying to work towards a > unified system for identifying fonts using the mandoc.h > enum mandoc_esc ESCAPE_FONT* identifiers. Having different > font identifiers for each output module is not good. > So i added ESCAPE_FONTCB and ESCAPE_FONTCI and used those. > A nice side effect is that CB and CI now work in HTML > for all of \f, .ft, and tbl(7) f and that tbl(7) fBI > now also works for terminal output. > >
> > > > > These become: > > This is great news! A bunch of my pages use C[BI] and the HTML renders look much better, thanks! > * GNU tbl(1) appears to ignore space characters between the f > modifier and the font name, so "lf B" is the same as "lfB". Huh, so it does! That's not explicitly mentioned by the manual and so I didn't think to test it. Now, tbl(1) says Key characters can be separated by spaces or tabs. so consider the following document: -- >8 -- =2ETS lfBI lf BI lf BI . a b c =2ETE -- >8 -- (In order, none, space, tab follow 'f'; base64: LlRTCmxmQkkJbGYgQkkJbGYJQkkJLgphCWIJYwouVEUK) groff renders it with a, b, and c as BI, but mandoc with your patch with a+b as BI and c as R, with -Tlint: mandoc: ./q.1:2:14: WARNING: unknown font, skipping request: TS f BI . If you change tbl_layout.c L171 to match L75: -- >8 -- - while (p[*pos] =3D=3D ' ') + while (p[*pos] =3D=3D ' ' || p[*pos] =3D=3D '\t') -- >8 -- and L187: -- >8 -- - if (strchr(" .", p[*pos + isz]) =3D=3D NULL) + if (strchr(" \t.", p[*pos + isz]) =3D=3D NULL) -- >8 -- The document renders correctly. > > Renders to a teletype with the expected fonts: > > b, ul, bul; b, ul, bul; normal, b, ul > Not quite. The expected output for lbi is ul, not bul. > The i overrides the b rather than add to it. > So lbi is the same as lfI, not as lfBI. Indeed, it looks like I got confused by the groff parsing and thought it'd accumulate instead. > Could you please check out from CVS (instead of the last release), > apply the following patch, and tell me whether it looks reasonable > and works for you? Yeah, save for the tab thing above, I haven't managed to fault it, in tests or real pages. > When this gets committed, i will credit you for reporting the > missing feature. Do i understand correctly that "Nabija" is your > first name and "Czleweli" your last name? They aren't, but either "=D0=BD=D0=B0=D0=B1" or "nabijaczleweli" is fine. Best, =D0=BD=D0=B0=D0=B1 --cx7lt76colzzicyr Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQIzBAABCgAdFiEEfWlHToQCjFzAxEFjvP0LAY0mWPEFAmERtW0ACgkQvP0LAY0m WPFEqg//bfs7TR/YcIchIfBAELYsJYXJzYldZidL7+E8Bqfx73Dr1CIES8KDRVCW SAfSd7PkoZfaffe132R0I2er9auTjKNMPW1ELRE/yF0scjK4wXcqtGqqiYJE0lq1 DgGGKNur7dYXFwcv9an8OEX1IE/23q8Xj4ldOb0VTMp/cv3C3/DIf2OqjV8g9X7w VHdR+Xg6VjeZevqISp+q8WrWbrG1HtEn8uY7gWd42LDKr+8fGN80KWwaWWiFRMFG R3HBpDLS0A2/8RLNInN/OOLRHqPs8cV60i/7DEmV3TbcroLhD+jE73pCY06KY1s8 ouKjxHKnNrV7ZpFhLInInmF7qMCmeU20XnJy2VuXXGe2lti71Uf2Fjm0PtMbeMrA 2WfL4aDSTHNH0m/46n6xCZMO2ox5A06488RNXOyF/UprN6NTTRSQgAhgE+r7JgJy Lmeef+mhVIncyrPdTENv5etYauspM7AS7awezNBfCqFtY/af1tuLR+0/R6qW2ukl JSSf/HSD5iqgLLel4oohX4XsyaWNT8TZaisLCrb+aYq+3LsQcwKkWTi2WHsVp8Sp k60stGPrHvI5xE0HHGzhScUU/DW4ZYx9oUa1OoetYrBz03mZfKd5B2vztaQIQzSO U56QnzjuvFvzV5fmEabxeebPfPUbyeyrZOlJjA9gx06YyZR79u4= =II0c -----END PGP SIGNATURE----- --cx7lt76colzzicyr-- -- To unsubscribe send an email to tech+unsubscribe@mandoc.bsd.lv From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on inbox.vuxu.org X-Spam-Level: X-Spam-Status: No, score=0.0 required=5.0 tests=UNPARSEABLE_RELAY autolearn=ham autolearn_force=no version=3.4.4 Received: (qmail 12175 invoked from network); 10 Aug 2021 13:44:06 -0000 Received: from bsd.lv (HELO mandoc.bsd.lv) (66.111.2.12) by inbox.vuxu.org with ESMTPUTF8; 10 Aug 2021 13:44:06 -0000 Received: from fantadrom.bsd.lv (localhost [127.0.0.1]) by mandoc.bsd.lv (OpenSMTPD) with ESMTP id 016e2859 for ; Tue, 10 Aug 2021 08:44:03 -0500 (EST) Received: from scc-mailout-kit-02.scc.kit.edu (scc-mailout-kit-02.scc.kit.edu [129.13.231.82]) by mandoc.bsd.lv (OpenSMTPD) with ESMTP id 9c1b1a30 for ; Tue, 10 Aug 2021 08:44:02 -0500 (EST) Received: from hekate.asta.kit.edu ([141.3.145.153] helo=hekate.usta.de) by scc-mailout-kit-02.scc.kit.edu with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (envelope-from ) id 1mDS2y-0001vS-Kw; Tue, 10 Aug 2021 15:44:01 +0200 Received: from donnerwolke.asta.kit.edu ([141.3.145.61] helo=donnerwolke.usta.de) by hekate.usta.de with esmtp (Exim 4.92.2) (envelope-from ) id 1mDS2w-0004CS-Sy; Tue, 10 Aug 2021 15:43:58 +0200 Received: from athene.asta.kit.edu ([141.3.145.60] helo=athene.usta.de) by donnerwolke.usta.de with esmtp (Exim 4.84_2) (envelope-from ) id 1mDS2w-0002rD-Oz; Tue, 10 Aug 2021 15:43:58 +0200 Received: from localhost (athene.usta.de [local]) by athene.usta.de (OpenSMTPD) with ESMTPA id dbee0d65; Tue, 10 Aug 2021 15:43:58 +0200 (CEST) Date: Tue, 10 Aug 2021 15:43:58 +0200 From: Ingo Schwarze To: nabijaczleweli@nabijaczleweli.xyz Cc: tech@mandoc.bsd.lv, 992002@bugs.debian.org Subject: Re: [PATCH][Debian#992002] tbl: allow two-character fonts and format fonts in -Thtml Message-ID: <20210810134358.GA19930@athene.usta.de> References: <20210808111135.zisbfzlqqdsq35om@tarta.nabijaczleweli.xyz> <20210808124919.hevbw4gv6pis72pq@tarta.nabijaczleweli.xyz> <20210808132452.bekkztprjqoup3pa@tarta.nabijaczleweli.xyz> <20210809085819.GA81032@athene.usta.de> <20210809230831.7lwnchffsqds42ax@tarta.nabijaczleweli.xyz> X-Mailinglist: mandoc-tech Reply-To: tech@mandoc.bsd.lv MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20210809230831.7lwnchffsqds42ax@tarta.nabijaczleweli.xyz> User-Agent: Mutt/1.12.2 (2019-09-21) Hi Nab, Nab wrote on Tue, Aug 10, 2021 at 01:08:31AM +0200: > On Mon, Aug 09, 2021 at 10:58:19AM +0200, Ingo Schwarze wrote: >> Nab wrote on Sun, Aug 08, 2021 at 03:24:53PM +0200: >>> tbl's -Thtml ignores font requests; >> Not in CVS HEAD; see https://cvsweb.bsd.lv/mandoc/tbl_html.c revision 1.34, >> committed on May 16 earlier this year. > Oh, indeed. I tested and based my patch on 1.14.5 from Debian, > didn't realise that's almost two years old by now. > Will use the CVS next time. Note that so far, everybody who contributed code to mandoc provided their first and last names. I'm not sure it is strictly required in the legal sense, but i do consider it beneficial both for authors and for users. The benefit for authors is that it makes it easier for them to exercise their rights under the Berne Convention, in particular their moral rights under that Convention, for example to protect themselves if somebody abuses their contribution for slander. The benefit for users of knowing who the Copyright holders are is also obvious, even if the code is BSD or ISC licensed: It makes Copyright and license audits easier and reduces the risk of suddenly being sued by parties the users didn't even know existed. In this case, it isn't needed because by mere chance, even though several of your ideas remained in the committed patch, none of your code did, because i switched from TBL_CELL_BOLD and TBL_CELL_ITALIC to ESCAPE_FONT*. Ideas aren't subject to Copyright, only text is, and for crediting a person who provided bug reports, feature requests, and ideas, a pseudonym is sufficient. >>> >>> >>> >> These become: >> >> > This is great news! A bunch of my pages use C[BI] and the HTML renders > look much better, thanks! Note that i don't recommend using these fonts in manual pages. Even with groff, typical installations don't prodide CB and CI fonts for terminal output, which typically results in warnings being thrown. The details may vary among operating systems and package managers even for the same version of groff. Portability to other formatters (like Heirloom, Plan 9, DWB, Solaris, neatroff) is even more doubtful, but i don't know any details about that. But as a rule, mandoc(1) even supports features if using them is unwise, as long as that doesn't cause an undue burden. One reason to do so is making existing pages look better, no matter how good or bad the style is that they are using. Not supporting a feature hurts end users - who aren't responsible for author's choices which features to use. But that a feature is supported by mandoc(1) should not be misinterpreted by authors as a free pass to go on a rampage and employ the most arcane and brittle features they manage to find. >> * GNU tbl(1) appears to ignore space characters between the f >> modifier and the font name, so "lf B" is the same as "lfB". > Huh, so it does! That's not explicitly mentioned by the manual and so > I didn't think to test it. No, i'm not even convinced it is intentional, and relying on it in any document would be a thoroughly bad idea. But mandoc(1) aims to be bug-compatible with groff unless there is a good reason to differ. > Now, tbl(1) says > Key characters can be separated by spaces or tabs. > so consider the following document: > -- >8 -- > .TS > lfBI lf BI lf BI . > a b c > .TE > -- >8 -- > (In order, none, space, tab follow 'f'; > base64: LlRTCmxmQkkJbGYgQkkJbGYJQkkJLgphCWIJYwouVEUK) > > groff renders it with a, b, and c as BI, > but mandoc with your patch with a+b as BI and c as R, with -Tlint: > mandoc: ./q.1:2:14: WARNING: unknown font, \ > skipping request: TS f BI . > > If you change tbl_layout.c L171 to match L75: > -- >8 -- > - while (p[*pos] == ' ') > + while (p[*pos] == ' ' || p[*pos] == '\t') > -- >8 -- > and L187: > -- >8 -- > - if (strchr(" .", p[*pos + isz]) == NULL) > + if (strchr(" \t.", p[*pos + isz]) == NULL) > -- >8 -- > The document renders correctly. Done in the commit cited below, thanks for pointing out that quirk. >> Could you please check out from CVS (instead of the last release), >> apply the following patch, and tell me whether it looks reasonable >> and works for you? > Yeah, save for the tab thing above, I haven't managed to fault it, > in tests or real pages. Thank you very much for testing. That patch ended up growing tentacles into quite a number of files, so the additional testing is highly appreciated. Here is the committed patch: https://inbox.vuxu.org/mandoc-source/c2aa6365c21bfcca@mandoc.bsd.lv/ Yours, Ingo -- To unsubscribe send an email to tech+unsubscribe@mandoc.bsd.lv
texttexttexttexttexttexttexttexttexttexttext texttexttexttexttexttexttexttexttexttexttext