Hi Martin,

At 2026-02-08T12:27:32+0100, Martin Lemaire wrote:
>  ,
> /|  |
>  |--|  ave you heard of something, perhaps a macro
>  |  |) that  would  help  me insert  a letter from
> figlet as a drop cap  at the beginning  of a given
> paragraph ?  Is grotty suited for such ornaments ?
> I assume it could look something like :
> 
>  1. cut first letter from paragraph
>  2. *somehow* invoke figlet to draw desired drop cap
>  3. read drop cap's (w)idth & (h)eight
>  4. set the paragraph, indenting h lines by w characters
>  5. insert the drop cap in the indented space
> 
> My understanding of *roff is limited.

I doubt it's impossible but it seems like it would be a tricky.

Thinking through the problem, here are my expectations.

It would require unsafe mode because you'd need to use the `pso` request
to run figlet, possibly with options configured by the input document in
some way.

It would require setting up a diversion and formatting the output of
figlet into it.

It would require the document (or macro package) to measure the height
and width of that diversion, so as to configure a temporary indent (in
the `in`, but not the `ti` sense) in the amount of the width of the
diversion, and lasting for as many vees as the height of the diversion.
These are in the `dl` and `dh` registers, respectively.

You might be able to get away without measuring the height if this was
an _input_ parameter to figet, because you'd already know it.

The document or macro package would have to decide what to do if the
drop cap ends up being taller than the paragraph, or would spring a trap
because the diversion's height would cause it to impinge on a footnote
area, footer, the bottom of the page's text area, or the actual page
bottom.  As above, if you already know the height because it's an input
parameter, the trap problem should be avoidable by preceding the
paragraph with a `ne` request using that height (in vees) as argument.

Anyone feel like taking this on as a project and want to contribute it
to groff 1.25?  :)

Regards,
Branden

Attachment: signature.asc
Description: PGP signature

Reply via email to