Follow-up Comment #18, bug #68256 (group groff): On Friday, 12 June 2026 20:49:33 BST G. Branden Robinson wrote: > Follow-up Comment #16, bug #68256 (group groff): > > Results from my working copy, using the changes alluded to in bug #68445. > Just a few notes on the temporary debug messages.
Nomenclature.
=============
Case 1 = 2arg = non-conditional
Case 2 = 3arg = conditional
>
> $ printf '.bd S R 4M\nGoodbye \(mu cruel world\[r!]
> \n'| ./build/test-groff -Z
> troff:<standard input>:1: debug: GBR: emboldening is conditional because
> first argument starts with non-numeral, character 'S'
In this case it is conditional but not just because arg1 is non-numeric, this
is a valid case 1:-
.bd TR 500
Where arg1 is non-numeric. The test should be non-numeric AND font is special
(since only 'special' fonts are allowed in conditional emboldening).
A further twist is that arg2 MUST be non-numeric for conditional case, because
our documentation specifically states that a font position may be used in case
1, but this caveat is not given to case 2, inferring only named fonts can be
used.
This reading of our documentation simplifies things:-
.bd 5 500 \" Bolden TR (mount point 5)
.bd TR 500 \" Bold TR
.bd 5 \" Unbold TR
.bd TR \" Unbold TR
.bd S TR 500 \" bold S if TR
Our documentation is a bit loose here:-
.bd font1 font2 [offset]
and then says:-
"If the second argument is missing, emboldening is turned off for this
particular current font."
Which only makes sense if it refers to the (only optional) 3rd arg [offset].
.bd S TR \" Turn off boldening of S when TR is current font.
If you want 'font2' to be a font position as well (which is not specifically
mentioned as it is for case 1) you create an unsolvable problem:-
.bd S 5 500 \" bold S if TR
.bd S 5 \" is this unbolding S if TR, or unconditional bold S by 5
Problem disappears if font positions are only allowed for unconditional
bolding, as our docs seem to imply.
This is why I believe ".bd S 3 3" could be a misreading of ".bd S B 3".
$ printf '.bd S B 3\n.ft 3\nHello \\(mu world\\(r!\n' | test-groff -Z
x T ps
x res 72000 1 1
x init
p1
x font 38 TB
f38
s10000
md
DFd
V12000
H72000
tHello
wx font 11 S
f11
h2500
Cmu --|
h2 | mumu
Cmu --|
wf38
h7990
tw
H112392
torld
Cr!
h3330
n12000 0
x trailer
V792000
x stop
> troff:<standard input>:1: debug: GBR: embolden_font_request(): CASE 1:
> enabling conditional emboldening of S by 400 when mounting position 5
> selected
[skip mumu proof]
>
> And here's your example from comment #14.
>
> $ cat ATTIC/68256-deri.groff
> .ps 18
> .vs 22
> .nf
> .ft B \" using TB
> This is bold
> 3 \[mu] 3 = 9
> lets strengthen the symbol
> .bd S B 4M
> 3 \[mu] 3 = 9
> $ ./build/test-groff ATTIC/68256-deri.groff | okular -
> Warning: Ignoring XDG_SESSION_TYPE=wayland on Gnome. Use
> QT_QPA_PLATFORM=wayland to run on Wayland anyway.
> troff:ATTIC/68256-deri.groff:8: debug: GBR: emboldening is conditional
> because first argument starts with non-numeral, character 'S'
Same as above, non-numerical arg1 not reliable indicator this will be
conditional form.
> troff:ATTIC/68256-deri.groff:8: debug: GBR: embolden_font_request(): CASE 1:
> enabling conditional emboldening of S by 720 when mounting position 38
> selected
>
>
> Here's an illustration of the quartet of {non-,}conditional
> {un,}emboldening.
>
>
> $ printf '.bd S 3 9\n' | ./build/test-groff -ww 2>&1 | grep . || echo NO
> OUTPUT
> troff:<standard input>:1: debug: GBR: emboldening is conditional because
> first argument starts with non-numeral, character 'S'
Should cause an error, font2 must be a font name else how would you know what
.bd S 3
means, is it undoing the above conditional or is it saying to bold font S
unconditionally when S is being used as a text font - \fS\(mu\fP - useful in
situations where you have more than 1 'special' font containing 'mu'.
> troff:<standard input>:1: debug: GBR: embolden_font_request(): CASE 1:
> enabling conditional emboldening of S by 9 when mounting position 38
> selected
> $ printf '.bd S 3\n' | ./build/test-groff -ww 2>&1 | grep . ||
> echo NO OUTPUT troff:<standard input>:1: debug: GBR: emboldening is
> conditional because first argument starts with non-numeral, character 'S'
> troff:<standard input>:1: debug: GBR: embolden_font_request(): CASE 2:
> disabling conditional emboldening of S when mounting position 38 selected
This is ambiguous, it could be an unconditional request to bold S by 3. The
only way to make sense of .bd syntax is to say font positions are not allowed
in the conditional format, only in the 2arg version where they are
specifically allowed.
Let's see which groff picks:
$ printf '.bd S 3\nHello \\fS\\(mu\\fP world\\(mu\\(r!\n' | test-groff -Z
x T ps
x res 72000 1 1
x init
p1
x font 5 TR
f5
s10000
md
DFd
V12000
H72000
tHello
wx font 11 S
f11
h2500
Cmu --|
h2 | mumu with S as text font
Cmu --|
wf5
h7990
tw
H111832
torld
f11
Cmu --| just a mu when looked up from special
f5
h5490
Cr!
h3330
n12000 0
x trailer
V792000
x stop
Ok, groff has decided this is an unconditional bold of font S. Not an
unemboldening of a conditional as the DBG message reports.
> $ printf '.bd 1 2\n' | ./build/test-groff -ww 2>&1 | grep . || echo NO
> OUTPUT troff:<standard input>:1: warning: interpreting second argument to
> font emboldening request as emboldening amount; use a font name instead of
> a mounting position as the first argument if conditional emboldening
> desired [-w style]
Why a warning, this is a perfectly valid request, as is
.bd R 2
which is not a conditional, but is a font name arg1.
> troff:<standard input>:1: debug: GBR: embolden_font_request(): CASE 3:
> enabling emboldening mounting position 5 by 2
> $ printf '.bd 1\n' | ./build/test-groff -ww 2>&1 | grep . || echo NO OUTPUT
> troff:<standard input>:1: debug: GBR: embolden_font_request(): CASE 4:
> disabling emboldening of mounting position 5
This one's spot on.
Cheers
Deri
_______________________________________________________
Reply to this item at:
<https://savannah.gnu.org/bugs/?68256>
_______________________________________________
Message sent via Savannah
https://savannah.gnu.org/
signature.asc
Description: PGP signature
