Follow-up Comment #30, bug #63354 (project groff):

To help support mission creep, I'm adding one item to the comment #28 to-do
list.

13. \[u2008]: refine for accuracy

U+2008 PUNCTUATION SPACE is generally defined as a space the width of a font's
period or comma.  Currently fallbacks.tmac aliases it to groff's hair space,
\^.  But examining the typeset output of the below groff input reveals that in
all the fonts that ship with groff, the period is closer in width to groff's
thin space (\|) than to its hair space.

.nf
.
.de show-spaces
.fam \\$1
Family \\$1
x\|x (thin space)
x.x
x\^x (hair space)
..
.
.show-spaces A
.show-spaces BM
.show-spaces C
.show-spaces H
.show-spaces N
.show-spaces P
.show-spaces T

(The letter "x" and the period should have no kerning between them in either
order, though I didn't verify this in the font files.)

In some font families, the thin space and the period are nearly the same
width; in others, the thin space is narrower.  In no case is the thin space
too wide.  Thus a space narrower than the thin space isn't appropriate for a
punctuation space.

So as a first cut, substituting \| for \^ in the \[u2008] definition in
fallbacks.tmac is an improvement.

Can we do better?  Groff has the ability to figure out the width of a period,
and make a horizontal movement to match it.  Add this line to the show-spaces
macro above:

x\h'\w"."u'x (punctuation space)

This creates a space the exact width of the font's period character, the
definition of a punctuation space.

But this won't work in an .fchar, whose RHS is evaluated upon definition
rather than interpolation.  Maybe some Tadziu-level wizardry can make it work.
 But even then, there are other potential pitfalls to consider.
* Some specialty fonts may lack a period character.
* \w has side effects (setting numerous registers) that may interfere with a
user's own use of these registers, since a user specifying a punctuation space
wouldn't necessarily (and shouldn't have to) know that its implementation
involves \w.

Anyway, for a fallback, the plain old \| is a good approximation of the space
needed, so when I get around to making that requested patch, that's what I
plan to use.


    _______________________________________________________

Reply to this item at:

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

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


Reply via email to