Re: [grotty] drop cap insertion

"G. Branden Robinson" <[email protected]>
Newsgroups gmane.comp.printing.groff.general
Message-ID <20260212221855.ennwfumfggpnyiyw@illithid>
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
signature.asc (application/pgp-signature, 833 B)
-----BEGIN PGP SIGNATURE-----

iQIzBAABCAAdFiEEh3PWHWjjDgcrENwa0Z6cfXEmbc4FAmmOUccACgkQ0Z6cfXEm
bc6yPA//TejrWMGjYd5/0GGUOXgphucV18YxyASDc0himhJkBp86yS+ytLBGa+ZP
mcKPgzUyfWMcylaZqXBpOiI+JFaDhhNumqZyJ4JcqtlldhZs3eMl0TlPzbsqXTou
ZVIHSLGN77gWfuXWtdwf/rwNTZXJH8TG8JrTAzlMihC+PFlM6yL/qkfAHFaH45zk
CMIGIns1EJJpl1mrhfBuCc9AhhmBoYHIAyn5gMDGW8tvo86nnJm0zNse71tgRjyb
Hryh/M7suybAvNS5gG/VJ8KXHisn9A+MQJ/EEv1tfsc+BZoT+JkV9azZ/9TioQCz
L5NEn+6SAj8Eh+a3HFpXUsnF3QnvwCDR6vjaldVtGte9X1gQ87hjrUqIQPh8LUk9
bGUzo42XSMqEqG8dKvhS1sKiSQagSI2QLyHn3iwz4dArIUUAO/EWkbE1+hpRAWnD
GNCtg4AFFWhFGosXc6uWi6t87wkZp12/sCFx9Jjrn1R2J2D55t4i3dds0TJqPZhf
kr03dh6zZDWV2OGmuy1n7iy408wWtzXmoWwImkoxs0cVJ5KXmV7JOfHsHoiQYTyv
h4XT4Mj9dv47HwjXEh8bz20Lfz85HdqyNOmUOSacH2FkgxltsScYD9aqlTYLMU9t
X00GD3wyBtbDjIOkIxHzbcNOvOr8x0o2XmrOipdQKSFxfCWk5+8=
=u6+I
-----END PGP SIGNATURE-----
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.