[comp.text] font families

rcd@ico.ISC.COM (Dick Dunn) (06/24/89)

In article <159@unmvax.unm.edu>, brainerd@unmvax.unm.edu (Walt Brainerd) writes:
. . .[stuff deleted]
> A feature we have not implemented, but think desirable is font families,
> so that switching to _italic_ means italic of the current font family,
> for example.

Could you elaborate?  Why is this hard, or more to the point, why does it
take a mod to troff?  Seems that what you want is a command to set a new
font family by some name selection; it needs to do some .fp's to get the
new fonts mounted where they belong (perhaps in all environments, depending
on what you think it should mean).  This ought to be easy with a macro.
I've done it the lazy way, as in:
	.de FF	\"	set font family (hides naming ugliness)
	.if '\\$1'T'  .F} R I B BI
	.if '\\$1'H'  .F} H HO HB HD
	.if '\\$1'P'  .F} PA PI PB PX
	.if '\\$1'NC' .F} nc nC Nc NC
etc.--these are the TranScript name conventions.  Yes, I should read the
stuff from a file instead of hard-wiring it...but this is enough to
illustrate.  The .F} is just a helper:
	.de F}
	.fp 1 \\$1
	.fp 2 \\$2
	.fp 3 \\$3
	.fp 4 \\$4
	..
Now, at this point you switch using \f1 through \f4, as the macro packages
do internally.  There's one more thing to help smooth this over--I define
some strings like:
	.ds i \f2
	.ds p \fP
(the latter just for consistency) so that instead of \fIitalic\fP, which
doesn't do what you want, or \f2italic\fP, which is obscure ("2" is not
really a mnemonic for "italic" to most of the world), you would write
\*iitalic\*p.

The one thing you really *don't* want to do is make \fI or .ft I change to
italic of the current font family--that's a change to troff semantics.
-- 
Dick Dunn      UUCP: {ncar,nbires}!ico!rcd           (303)449-2870
   ...Lately it occurs to me what a long, strange trip it's been.

brainerd@unmvax.unm.edu (Walt Brainerd) (06/25/89)

In article <15877@vail.ICO.ISC.COM>, rcd@ico.ISC.COM (Dick Dunn) writes:
> 
> The one thing you really *don't* want to do is make \fI or .ft I change to
> italic of the current font family--that's a change to troff semantics.
> -- 

No, this is _not_ a change in troff semantics if it is in the context of
a previously executed .font.family (or whatever) command that is not
a "standard" troff command.  This is one of the things that is desired
so that one can take an existing source file and process it using
more than one font family without changing all of the usual commands
of the sort .ft I and  \fI.