From: наб <nabijaczleweli@nabijaczleweli.xyz>
To: Ingo Schwarze <schwarze@usta.de>
Cc: tech@mandoc.bsd.lv, 992002@bugs.debian.org
Subject: Re: [PATCH][Debian#992002] tbl: allow two-character fonts and format fonts in -Thtml
Date: Tue, 10 Aug 2021 01:08:31 +0200 [thread overview]
Message-ID: <20210809230831.7lwnchffsqds42ax@tarta.nabijaczleweli.xyz> (raw)
In-Reply-To: <20210809085819.GA81032@athene.usta.de>
[-- Attachment #1: Type: text/plain, Size: 3140 bytes --]
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.
> 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.
> > <td><span class="Li">text</span></td>
> > <td><b>text</b></td>
> > <td><i>text</i></td>
> These become:
> <td><span class="Li"><b>text</b></span></td>
> <td><span class="Li"><i>text</i></span></td>
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 --
.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.
> > 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 "наб" or "nabijaczleweli" is fine.
Best,
наб
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 833 bytes --]
next prev parent reply other threads:[~2021-08-09 23:08 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <20210808111135.zisbfzlqqdsq35om@tarta.nabijaczleweli.xyz>
[not found] ` <handler.992002.B.162842110127724.ack@bugs.debian.org>
[not found] ` <20210808124919.hevbw4gv6pis72pq@tarta.nabijaczleweli.xyz>
[not found] ` <CANnVG6k_czNfH5qNt9N3oOFF+v2i0eNfF92GO5vVK1sad9TRTw@mail.gmail.com>
2021-08-08 13:24 ` наб
2021-08-09 8:58 ` Ingo Schwarze
2021-08-09 23:08 ` наб [this message]
2021-08-10 13:43 ` Ingo Schwarze
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20210809230831.7lwnchffsqds42ax@tarta.nabijaczleweli.xyz \
--to=nabijaczleweli@nabijaczleweli.xyz \
--cc=992002@bugs.debian.org \
--cc=schwarze@usta.de \
--cc=tech@mandoc.bsd.lv \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).