• One-Page Dungeon format in groff?

    From Laurens Kils-Huetten@21:1/5 to All on Sat Aug 13 08:38:40 2022
    Hello UNIX Afficionados and Dungeon Delvers,

    yesterday I once more discoverered, how ridiculously fast groff
    is compared to other typesetting toolchains like LaTeX, Python +
    weasyprint or whatever.

    Since I enjoy using fast UNIX tools to build some dungeons in my
    spare time, I wonder how much work it'll take to reproduce the
    classic One Page Dungeon layout in groff. Just in case you don't
    know, the layout would simply look like this:

    -------------------------------
    | --------------- Table with |
    || | random |
    || Map of the | encounters, |
    || | various |
    || Dungeon | general |
    || | descriptions|
    || Level | of the level|
    || | And finally |
    | --------------- a key with |
    | descriptions of each |
    | individual room of the |
    | dungeon. Basically it's a |
    | page, with one top-left |
    | aligned image and text |
    | floating around the image. |
    | That shouldn't be too hard. |
    | Nothing fancy really ... |
    --------------------------------

    The text might extend to the facing uneven page, thus creating a
    two page spread for the level.

    Of course I tried what groff seems to deliver out of the box, but
    I find that displays typically use up a page width, or column
    width, with text continuing below the image, but not floating
    around the image like i've shown.

    So, any ideas how to do this in groff? Maybe one of the common
    macro packages already supports this kind of layout, only I
    haven't discoverered it, yet?

    Thanks in advance,
    cheers,

    ~lkh

    --
    https://sdf-eu.org/~lkh

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Laurens Kils-Huetten@21:1/5 to Laurens Kils-Huetten on Sat Aug 13 22:11:59 2022
    Laurens Kils-Huetten <lkh@sdf-eu.org> wrote:
    Since I enjoy using fast UNIX tools to build some dungeons in my
    spare time, I wonder how much work it'll take to reproduce the
    classic One Page Dungeon layout in groff. Just in case you don't
    know, the layout would simply look like this:

    -------------------------------
    | --------------- Table with |
    || | random |
    || Map of the | encounters, |
    || | various |
    || Dungeon | general |
    || | descriptions|
    || Level | of the level|
    || | And finally |
    | --------------- a key with |
    | descriptions of each |
    | individual room of the |
    | dungeon. Basically it's a |
    | page, with one top-left |
    | aligned image and text |
    | floating around the image. |
    | That shouldn't be too hard. |
    | Nothing fancy really ... |
    --------------------------------

    So after some digging around in the archives, and cracking open
    *UNIX Text Processing* by Dougherty and O'Reilly, here's my basic
    proof of concept: https://ttm.sh/qhr.png

    Macros follow, cheers! ~lkh

    .\" Macros to typeset One Page Dungeons
    .\" in groff
    .\"
    .de opdMap \" start with the map
    .br
    .mk a \" Mark current position
    .PSPIC -L \\$1 4i \" insert map image 4 inches wide
    .br
    .mk b \" Mark lower edge of map
    ..
    .de opdSB \" start the side bar
    .sp |\\nau \" move back to mark a
    .in +4.2i \" increase indent by 4.2 inches
    . \" left margin is now just right
    . \" of the map
    .ft R
    ..
    .de opdH \" section header for opd stuff
    .sp 1v
    .ft B
    ..
    .de opdLB \" opd begin entries
    .ft R
    .in +1.3
    .br
    ..
    .de opdLI \" opd list entries
    .br
    .ti -1.3
    ..
    .de opdLE \" opd end list
    .in -1.3
    .br
    ..
    .de opdEN \" end of special opd stuff
    .br \" break line, just to make sure
    .sp |\\nbu \" move to mark b
    . \" that's the lower edge of the map
    . \" we marked above
    .sp 1v
    ..

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Tavis Ormandy@21:1/5 to Laurens Kils-Huetten on Mon Aug 15 06:10:46 2022
    On 2022-08-13, Laurens Kils-Huetten wrote:
    So after some digging around in the archives, and cracking open
    *UNIX Text Processing* by Dougherty and O'Reilly, here's my basic
    proof of concept: https://ttm.sh/qhr.png


    Looks great, is the map drawn in PostScript? If not it could be fun to
    do that :)

    Tavis.

    --
    _o) $ lynx lock.cmpxchg8b.com
    /\\ _o) _o) $ finger taviso@sdf.org
    _\_V _( ) _( ) @taviso

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Laurens =?ISO-8859-1?Q?Kils=2DH=FCt@21:1/5 to Tavis Ormandy on Mon Aug 15 06:20:10 2022
    Tavis Ormandy <taviso@gmail.com> wrote:
    On 2022-08-13, Laurens Kils-Huetten wrote:
    So after some digging around in the archives, and cracking open
    *UNIX Text Processing* by Dougherty and O'Reilly, here's my basic
    proof of concept: https://ttm.sh/qhr.png


    Looks great, is the map drawn in PostScript?

    The map was done in gridmapper: https://campaignwiki.org/gridmapper
    exported to png and converted to eps.

    If not it could be fun to

    I used this map for the example. Normally I'd draw in Inkscape and
    export to eps directly.

    cheers,

    ~lkh


    --
    Laurens Kils-Hütten
    https://sdf-eu.org/~lkh

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Laurens Kils-Huetten@21:1/5 to All on Mon Aug 15 11:38:25 2022
    Finally the working code looks thus:

    .\" Macros to typeset One Page Dungeons
    .\" in groff tested with -ms macros
    .\" and groff 1.22.4
    .\"
    .de opdMap \" start with the map
    .br
    .mk a \" Mark current position
    .PSPIC -L \\$1 4i \" insert map image
    .mk b \" Mark lower edge of map
    .sp |\\nau \" move back up to mark a
    .\".na \" uncomment for ragged right
    .po +4i \" increase page offset by image width
    .nr LL -4i \" reduce line length accordingly
    . \" left margin is now just right
    . \" of the map
    .wh \\nbu-1v opdEM1 \" last line before
    . \" end of the map
    .wh \\nbu opdEM2 \" end the map
    ..
    .de opdEM1 \" end of special opd stuff
    .ll +4i \" reset line lenth
    .nr LL +4i \" margin and line length
    ..
    .de opdEM2 \" end of special opd stuff
    .po -4i \" reset offset to the original
    .ad \" resume adjusting
    ..

    A working example can be found here: https://ttm.sh/qdR.tgz

    Cheers,

    ~lkh

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From andres@21:1/5 to Tavis Ormandy on Mon Aug 15 12:16:00 2022
    On 2022-08-15, Tavis Ormandy <taviso@gmail.com> wrote:
    On 2022-08-13, Laurens Kils-Huetten wrote:
    So after some digging around in the archives, and cracking open
    *UNIX Text Processing* by Dougherty and O'Reilly, here's my basic
    proof of concept: https://ttm.sh/qhr.png


    Looks great, is the map drawn in PostScript? If not it could be fun to
    do that :)

    Tavis.


    I'd use some tool like gramscii for that.

    git://bitreich.org/gramscii

    Dumb simple, vi keys, ascii output.

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Eli the Bearded@21:1/5 to lkh@sdf-eu.org on Mon Aug 15 23:21:02 2022
    In comp.unix.misc, Laurens Kils-Huetten <lkh@sdf-eu.org> wrote:
    Finally the working code looks thus:

    .\" Macros to typeset One Page Dungeons
    .\" in groff tested with -ms macros
    .\" and groff 1.22.4

    Neat. Thanks for posting that. I'd have seriously considered tbl, but
    this looks cleaner.

    Elijah
    ------
    hasn't done any *roff in years but holds a soft spot for it

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)