Follow-up Comment #11, bug #67252 (group groff):

gbranden@ Tue 08 Jul 2025 10:35:35 PM GMT:

> I don't know how hard a problem the issue in the present ticket
> poses for mandoc(1)'s tbl implementation.

From a purist perspective, the problem is untractable, because

 (1) The mandoc parse tree is supposed to be independent of the
     output device.
 (2) The tbl(7) geometry is supposed to be based solely on the
     parse tree, i.e. independent of the output device as well.

From that perspective, mandoc(1) decides about the width of table
columns before it even knows what the output device will be.

That problem is not all that much related to how wide fallback
strings are compared to the unavailable characters they replace.
There are *many* features in groff that calculate widths depending
on the output device and can then be used to change parsing,
all of which, from the mandoc(1) perspective, are layering violations,
for exampke the \w, \h, \l, and \n escape sequences, the .nr request,
any kind of scaled widths (for example in terminal and PDF output,
1u means a totally defferent thing), and even font selection.
So fallbacks aren't really special.


From a practical perspective, i have given up on implementing the
pure design described above.  While (1) the parse tree is still
mostly device independent, for some time now, (2) the module "out.c"
that was in theory supposed to be the device-independent, common
part of all output modules, and that in particular contains the
tblcalc() function governing tbl(7) column widths, has been
calling device-dependent measurement functions, resulting in the
table widths actually depending on the output device.

For example:

   $ man -T ascii -l man/groff_char.7.man
  [...]
     {}                    \[es]          u2205        empty set +
     <element of>          \[mo]          u2208        element of a set +
     <not element of>      \[nm]          u2208_0338   not element of set
     <proper subset>       \[sb]          u2282        proper subset +
     <not subset>          \[nb]          u2282_0338   not subset
     <proper superset>     \[sp]          u2283        proper superset +
     <not superset>        \[nc]          u2283_0338   not superset
     <subset or equal>     \[ib]          u2286        subset or equal +
     <superset or equal>   \[ip]          u2287        superset or equal +
     <intersection>        \[ca]          u2229        intersection, cap +
     <union>               \[cu]          u222A        union, cup +

Sure, a few lines end up wider than 78 columns, but overall, the
page looks quite reasonable with mandoc(1).

I don't quite understand what needs fixing here (except that general
simplification and fewer knobs to teak would of course be welcome).
But maybe that's just me, i didn't try very hard to wrap my head
around what you are discussing here.



    _______________________________________________________

Reply to this item at:

  <https://savannah.gnu.org/bugs/?67252>

_______________________________________________
Message sent via Savannah
https://savannah.gnu.org/

Attachment: signature.asc
Description: PGP signature

Reply via email to