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. >>> text >>> text >>> text >> These become: >> text >> text > 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