groff
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

units used in `ss` request (was: device-dependent warnings)


From: G. Branden Robinson
Subject: units used in `ss` request (was: device-dependent warnings)
Date: Sat, 13 May 2023 02:03:09 -0500

At 2023-05-10T12:28:02-0500, Dave Kemper wrote:
> On 5/10/23, Dave Kemper <saint.snit@gmail.com> wrote:
> > Nonintuitively, .ss's units aren't in fractions of standard
> > typographical measurements, but 1/12 of the current font's ordinary
> > space.
> 
> And I just learned (or maybe relearned) this is a deviation from AT&T
> troff's .ss units, which are a fixed 1/36 em.

You might need to unlearn it.

$ cat ./EXPERIMENTS/ss.roff
.nf
A B
.ss 12
A B
.ss 36
A B

(One "cp -l" later...)

DWB 3.3 troff does indeed appear to use thirty-sixths.

$ DWBHOME=. ./bin/troff ./ss.roff
x T post
x res 720 1 1
x init
V0
p1
x font 1 R
x font 2 I
x font 3 B
x font 4 BI
x font 5 CW
x font 6 H
x font 7 HI
x font 8 HB
x font 9 S1
x font 10 S
s10
f1
H720
V120
cA
w97Bn120 0
H720
V240
cA
w97Bn120 0
H720
V360
cA
wh147cB
n120 0
x trailer
V7920
x stop

One doesn't have to be able to decompile Kernighan's page description
language to see that the inter-word space is the same for the first two
instances of "A" and "B", and different for the third.

(Observe how "97" increased to "147".  This is the amount of motion
necessary to advance past the "A" itself _plus_ the inter-word space.)

What about groff?

$ ./build/troff -F build/font -F font ./EXPERIMENTS/ss.roff
x T ps
x res 72000 1 1
x init
p1
x font 5 TR
f5
s10000
V12000
H72000
md
DFd
tA
wh2500
tB
n12000 0
V24000
H72000
tA
wh2500
tB
n12000 0
V36000
H72000
tA
wh7500
tB
n12000 0
x trailer
V792000
x stop

Here, what's going on is a little more obvious since we're using grout's
"t" command instead of Kernighan's optimized syntax for moving and then
writing a glyph.

"h2500" is used in the first two cases, and "h7500" in the third.

It would therefore appear that groff is not deviating from AT&T behavior
here, but using 36ths after all, and our documentation is wrong (and has
been for a long time).

Regards,
Branden

Attachment: signature.asc
Description: PGP signature


reply via email to

[Prev in Thread] Current Thread [Next in Thread]