Bug 9312 - MM macro support for font family
Summary: MM macro support for font family
Keywords:
Status: CLOSED WONTFIX
Alias: None
Product: Red Hat Linux
Classification: Retired
Component: groff
Version: 6.1
Hardware: All
OS: Linux
medium
medium
Target Milestone: ---
Assignee: Florian La Roche
QA Contact:
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2000-02-10 17:21 UTC by degraaf
Modified: 2008-05-01 15:37 UTC (History)
0 users

Fixed In Version:
Clone Of:
Environment:
Last Closed: 2000-05-22 15:47:48 UTC
Embargoed:


Attachments (Terms of Use)

Description degraaf 2000-02-10 17:21:37 UTC
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

2517c2517
< \fB\\$1\fP\\$2
---
> \f3\\$1\fP\\$2
2540c2540
< \!\fB\\$1\fP\\$2
---
> \!\f3\\$1\fP\\$2
2544c2544
< \!\fB\\$1\fP\\$2
---
> \!\f3\\$1\fP\\$2
2604c2604
< .ft R
---
> .ft 1
2623,2624c2623,2624
< .ie \\n[.$] .fnt@switch \fB \f[\\n[.f]] \\$@
< .el .ft B
---
> .ie \\n[.$] .fnt@switch \f3 \f[\\n[.f]] \\$@
> .el .ft 3
2627,2628c2627,2628
< .ie \\n[.$] .fnt@switch \fI \f[\\n[.f]] \\$@
< .el .ft I
---
> .ie \\n[.$] .fnt@switch \f2 \f[\\n[.f]] \\$@
> .el .ft 2
2631c2631
< .if \\n[.$] .fnt@switch \fI \fB \\$@
---
> .if \\n[.$] .fnt@switch \f2 \f3 \\$@
2634c2634
< .if \\n[.$] .fnt@switch \fB \fI \\$@
---
> .if \\n[.$] .fnt@switch \f3 \f2 \\$@
2637c2637
< .if \\n[.$] .fnt@switch \fI \fR \\$@
---
> .if \\n[.$] .fnt@switch \f2 \f1 \\$@
2640c2640
< .if \\n[.$] .fnt@switch \fR \fI \\$@
---
> .if \\n[.$] .fnt@switch \f1 \f2 \\$@
2643c2643
< .if \\n[.$] .fnt@switch \fR \fB \\$@
---
> .if \\n[.$] .fnt@switch \f1 \f3 \\$@
2646c2646
< .if \\n[.$] .fnt@switch \fB \fR \\$@
---
> .if \\n[.$] .fnt@switch \f3 \f1 \\$@
2770c2770
< \fI\\*[Rp]\fP
---
> \f2\\*[Rp]\fP
2845c2845
< \s+4\fB\\*[App]\ \\$1\fP\s0
---
> \s+4\f3\\*[App]\ \\$1\fP\s0
2848c2848
< \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 18:26:59 UTC
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 15:47:59 UTC
assign to laroche

Comment 3 Florian La Roche 2002-11-11 13:22:59 UTC
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.

greetings,

Florian La Roche



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