groff
[Top][All Lists]
Advanced

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

Re: [Groff] devps/DESC, the font line, and too many fonts...


From: Werner LEMBERG
Subject: Re: [Groff] devps/DESC, the font line, and too many fonts...
Date: Fri, 23 Mar 2001 21:04:18 +0100 (CET)

Sorry for not answering earlier.  Right now I'm in the process to
check and update the `fonts' chapter in groff.texinfo, so I can
finally provide reliable information :-)

> We have a lot of Type1 fonts here, and we need to make more than 100
> available to grops. I've installed a lot into the right directory
> using afmtodit, and updated the download file, but I haven't touched
> the font line in DESC.
> 
> Is this bad?

No.  Basically, the `fonts' line is an anachronism to provide
backwards compatibility with Unix troff, making old macro packages
work which explicitly use font positions.  IMHO it is much cleaner to
load a small macro file to set up font styles only:

  .de RegisterStyle
  .  sty \\n[.fp] \\$1
  ..
  .
  \# set up styles for standard fonts (can be omitted for PS fonts
  \# due to the `styles' line in the DESC file)
  .RegisterStyle R
  .RegisterStyle I
  .RegisterStyle B
  .RegisterStyle BI
  .
  \# set up styles for `Univers' font family
  .RegisterStyle ExtraBlack
  .RegisterStyle ExtraBlackObl
  .
  \# etc. etc.

Fonts should then be loaded on demand:

  .fam H            \# we want the Helvetica family
  .ft B             \# this loads H+B = HB
  text
  .fam Univers-
  .ft ExtraBlackObl \# this loads Univers-ExtraBlackObl
  text

> The installation seems to work; I can do:
> 
>  .ft Univers-ExtraBlackObl
>  Univers-ExtraBlackObl just happens to be extra black and oblique.
> 
> and it works as expected. But by not installing fonts in a numerical
> position, will I make problems for myself later?

No.  groff can work with an unlimited number of fonts.

> We will always be naming fonts explicitly, as far as I can tell.
> While it would be nice to set up font families so we can do implicit
> style changing, stuff like this gets complex when you're using
> Univers, of which we have 33 styles...

See above.  Note that this scheme currently has a drawback: If you say
`.fam Univers-', gtroff tests whether the style at position 1 does
exist.  Normally, style `R' is at position 1, so the font `Univers-R'
must be available (a simple temporary solution is to do a soft link).

I believe that this restriction is unnecessary, and I'll look into the
code whether I can remove it, delaying a possible error to the first
use of `.ft'.


    Werner

reply via email to

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