Bug 9312 - MM macro support for font family
MM macro support for font family
Product: Red Hat Linux
Classification: Retired
Component: groff (Show other bugs)
All Linux
medium Severity medium
: ---
: ---
Assigned To: Florian La Roche
Depends On:
  Show dependency treegraph
Reported: 2000-02-10 12:21 EST by degraaf
Modified: 2008-05-01 11:37 EDT (History)
0 users

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Last Closed: 2000-05-22 11:47:48 EDT
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---

Attachments (Terms of Use)

  None (edit)
Description degraaf 2000-02-10 12:21:37 EST
I am gratified that groff and the MM macros are being actively
maintained.  They remain an essential tool and it's wonderful to have
such a faithful reimplementation in Linux.

Years ago at Bell Labs, I wrote these golden words about the MM
macros:    :-)
  "According to the PostScript Tutorial and Cookbook, 'A font is a
  collection of characters with a unified design.  The design itself
  is referred to as a typeface.  A set of typefaces designed to work
  together in a pleasing way is called a typeface family.'

  The MM macros, .R .I .B .RI .RB .IR .IB .BR and .BI, provide a
  powerful and convenient way to pop around among the Roman, Italic
  and Bold fonts.  ...  The MM macros do not explicitly mention the R,
  I, and B fonts.  Instead they use mounted fonts 1, 2 and 3.
  Therefore simply by using the troff commands to mount the Roman,
  Italic and Bold members of a family in font positions 1, 2 and 3
  we can have full use of any font family."

  For example, to use the New Century Schoolbook family instead of the
  default Times Roman, insert these mount commands at the beginning of
  a document:
      .fp 1 NR
      .fp 2 NI
      .fp 3 NB

I should add this does not preclude switching to another font, but one
must be be careful not to accidentally return to \fR instead of \f1.

This capability seems to be missing from the groff package, but is
easily added.  Simply replace each instance of an explicit font by it's
position number, ie

        \fR     ->      \f1
        \fI     ->      \f2
        \fB     ->      \f3
        .ft R   ->      .ft 1
        .ft I   ->      .ft 2
        .ft B   ->      .ft 3

I think only tmac.mm needs to be changed.  I have run some empirical
tests but cannot be certain I've covered every case.
It's not clear to me whether similar changes should be made in the
mm/*.MT files.  I think not.  These seem to dictate the style of
various headers, and probably should not be altered.

Here is the diff for tmac.m:

# diff tmac.mSTD tmac.mDAD

< \fB\\$1\fP\\$2
> \f3\\$1\fP\\$2
< \!\fB\\$1\fP\\$2
> \!\f3\\$1\fP\\$2
< \!\fB\\$1\fP\\$2
> \!\f3\\$1\fP\\$2
< .ft R
> .ft 1
< .ie \\n[.$] .fnt@switch \fB \f[\\n[.f]] \\$@
< .el .ft B
> .ie \\n[.$] .fnt@switch \f3 \f[\\n[.f]] \\$@
> .el .ft 3
< .ie \\n[.$] .fnt@switch \fI \f[\\n[.f]] \\$@
< .el .ft I
> .ie \\n[.$] .fnt@switch \f2 \f[\\n[.f]] \\$@
> .el .ft 2
< .if \\n[.$] .fnt@switch \fI \fB \\$@
> .if \\n[.$] .fnt@switch \f2 \f3 \\$@
< .if \\n[.$] .fnt@switch \fB \fI \\$@
> .if \\n[.$] .fnt@switch \f3 \f2 \\$@
< .if \\n[.$] .fnt@switch \fI \fR \\$@
> .if \\n[.$] .fnt@switch \f2 \f1 \\$@
< .if \\n[.$] .fnt@switch \fR \fI \\$@
> .if \\n[.$] .fnt@switch \f1 \f2 \\$@
< .if \\n[.$] .fnt@switch \fR \fB \\$@
> .if \\n[.$] .fnt@switch \f1 \f3 \\$@
< .if \\n[.$] .fnt@switch \fB \fR \\$@
> .if \\n[.$] .fnt@switch \f3 \f1 \\$@
< \fI\\*[Rp]\fP
> \f2\\*[Rp]\fP
< \s+4\fB\\*[App]\ \\$1\fP\s0
> \s+4\f3\\*[App]\ \\$1\fP\s0
< \fB\s+2\\$2\s0\fP
> \f3\s+2\\$2\s0\fP

May I then also suggest this slight alteration for groff_mm(7):

B [bold-text] [prev-text] ...
  With no arguments, switch to bold; with arguments, alternate -  print
  first argument in bold, second in previous font, third in bold, etc.
  Any number of arguments are permitted; all will be concatenated without
  added whitespace.  Whitespace may be included if it is quoted.

  The B, I and R macros specify Bold, Italic and Roman, respectively,
  for the odd arguments.
  The BI, BR, IB, IR, RB and RI macros explicitly specify the font for
  both the odd and even arguments.

  R I and B refer to the fonts mounted as 1, 2 and 3, which are
  Times-Roman, Times-Italic and Times-Bold by default.  To use a
  different typeface family such as New Century Schoolbook, mount all
  three components, eg
        .fp 1 NR
        .fp 2 NI
        .fp 3 NB
Comment 1 Jeff Johnson 2000-05-14 14:26:59 EDT
This looks like a good idea, but your "cannot be certain I've covered every
case" gives me pause. Um, exactly how certain are you, and what types of
breakage might we expect? (sez' a blissfully clueless groff maintainer :-)
Comment 2 Cristian Gafton 2000-05-22 11:47:59 EDT
assign to laroche
Comment 3 Florian La Roche 2002-11-11 08:22:59 EST
I'd be much more comfortable if this would be discussed with the upstream
maintainer of groff. Otherwise I fear that we would have to implement this
change for a longer time within Red Hat Linux sources.


Florian La Roche

Note You need to log in before you can comment on or make changes to this bug.