[comp.text.tex] PostScript fonts using Mittelbach and Schoepf

spqr@ecs.soton.ac.uk (Sebastian Rahtz) (06/05/90)

Now that Frank Mittelbach and Rainer Schoepf have let their font
selection scheme out into the marketoplace, maybe people are starting
to use it. Here's my suggestion on one obvious scheme, using
PostScript fonts in TeX. It doesn't do anything about the encoding
problem, but it does mean that my `palatino.sty' looks like this:

 \adobeencoding% I happen to encode things in Adobe-form, and get TeX
               % to sort out its act with macros
 \sansfont{helvetica}%
 \typewriterfont{courier}%
 \romanfont{palatino}%

The appended code simply gets added to your favourite `fontdef.tex'
when you create a new LaTeX format file. The point is to demonstrate
that there *will* be a simple answer in the future to people who say
`how do I use PS fonts in LaTeX?' - it is not supposed to the
`correct' solution.

Sebastian Rahtz

%% Generalized scheme for PostScript fonts, assuming they
%% all have the same basic structure
\def\postscript@fontdef#1#2#3#4#5#6#7#8{
% 1 : full name for family
% 2 : short name for family
% 3 : tfm name for normal font
% 4 : tfm name for italic font
% 5 : tfm name for bold font
% 6 : tfm name for bolditalic font
% 7 : tfm name for smallcaps font
% 8 : tfm name for slanted font
\immediate\write\sixt@@n
  {********************************************************************}
\immediate\write\sixt@@n
  {Defining fonts for PostScript #1 family }
\new@fontshape{#2}{m}{n}{%
      <5>#3 at5pt%
      <6>#3 at6pt%
      <7>#3 at7pt%
      <8>#3 at8pt%
      <9>#3 at9pt%
      <10>#3 at10pt%
      <11>#3 at11pt%
      <12>#3 at12pt%
      <14>#3 at14pt%
      <17>#3 at17pt%
      <20>#3 at20pt%
      <25>#3 at25pt}{}
\extra@def{#2}{}{}

\new@fontshape{#2}{m}{sc}{%
      <5>#7 at5pt%
      <6>#7 at6pt%
      <7>#7 at7pt%
      <8>#7 at8pt%
      <9>#7 at9pt%
      <10>#7 at10pt%
      <11>#7 at11pt%
      <12>#7 at12pt%
      <14>#7 at14pt%
      <17>#7 at17pt%
      <20>#7 at20pt%
      <25>#7 at25pt%
      }{}


\new@fontshape{#2}{m}{it}{%
      <5>#4 at5pt%
      <6>#4 at6pt%
      <7>#4 at7pt%
      <8>#4 at8pt%
      <9>#4 at9pt%
      <10>#4 at10pt%
      <11>#4 at11pt%
      <12>#4 at12pt%
      <14>#4 at14pt%
      <17>#4 at17pt%
      <20>#4 at20pt%
      <25>#4 at25pt%
      }{}

\new@fontshape{#2}{m}{sl}{%
      <5>#8 at5pt%
      <6>#8 at6pt%
      <7>#8 at7pt%
      <8>#8 at8pt%
      <9>#8 at9pt%
      <10>#8 at10pt%
      <11>#8 at11pt%
      <12>#8 at12pt%
      <14>#8 at14pt%
      <17>#8 at17pt%
      <20>#8 at20pt%
      <25>#8 at25pt%
      }{}

\new@fontshape{#2}{bx}{n}{%
      <5>#5 at6pt%
      <6>#5 at6pt%
      <7>#5 at7pt%
      <8>#5 at8pt%
      <9>#5 at9pt%
      <10>#5 at10pt%
      <11>#5 at11pt%
      <12>#5 at12pt%
      <14>#5 at14pt%
      <17>#5 at17pt%
      <20>#5 at20pt%
      <25>#5 at25pt%
      }{}

\new@fontshape{#2}{bx}{it}{%
      <5>#6 at6pt%
      <6>#6 at6pt%
      <7>#6 at7pt%
      <8>#6 at8pt%
      <9>#6 at9pt%
      <10>#6 at10pt%
      <11>#6 at11pt%
      <12>#6 at12pt%
      <14>#6 at14pt%
      <17>#6 at17pt%
      <20>#6 at20pt%
      <25>#6 at25pt%
      }{}


% bold and bold-extended regarded as the same
% slanted and smallcaps only in normal font
\subst@fontshape{#2}{b}{sc}{#2}{m}{sc}
\subst@fontshape{#2}{b}{sl}{#2}{m}{sl}
\subst@fontshape{#2}{bx}{sc}{#2}{m}{sc}
\subst@fontshape{#2}{bx}{sl}{#2}{m}{sl}
\subst@fontshape{#2}{b}{n}{#2}{bx}{n}
\subst@fontshape{#2}{b}{it}{#2}{bx}{it}
}
%
% set up all the fonts I am interested in
%
\postscript@fontdef{Lucida}{lucida}{l+rom}{l+ita}{l+bol}{l+bit}{l+sc}{l+sl}
\postscript@fontdef{LucidaSans}{lucidasans}{ls+rom}{ls+sl}{ls+bol}{ls+bit}{ls+sc}{ls+sl}
\postscript@fontdef{AvantGarde}{avant}{ag+book}{ag+bobl}{ag+demi}{ag+dobl}{ag+sc}{ag+sl}
\postscript@fontdef{Bookman}{bkman}{b+lig}{b+ligita}{b+demi}{b+dita}{b+sc}{b+sl}
\postscript@fontdef{Baskerville}{baskerville}{bs+rom}{bs+ita}{bs+bol}{bs+bit}{bs+sc}{bs+sl}
\postscript@fontdef{Courier}{courier}{c+med}{c+obl}{c+bol}{c+bob}{c+med}{c+med}
\postscript@fontdef{Glypha}{glypha}{g+rom}{g+obl}{g+bol}{g+bolobl}{g+sc}{g+sl}
\postscript@fontdef{Garamond}{garamond}{gr+light}{gr+liit}{gr+bol}{gr+bolit}{gr+sc}{gr+sl}
\postscript@fontdef{Helvetica}{helvetica}{h+med}{h+obl}{h+bol}{h+bolobl}{h+med}{h+med}
\postscript@fontdef{NewCenturySchoolbook}{ncs}{nc+rom}{nc+ita}{nc+bol}{nc+bita}{nc+sc}{nc+sl}
\postscript@fontdef{Optima}{optima}{o+rom}{o+obl}{o+bol}{o+bolobl}{o+sc}{o+sl}
\postscript@fontdef{Palatino}{palatino}{p+rom}{p+ita}{p+bol}{p+bolit}{p+sc}{p+sl}
\postscript@fontdef{Souvenir}{souvenir}{s+rom}{s+ita}{s+demi}{s+demit}{s+sc}{s+sl}
\postscript@fontdef{Times}{times}{t+rom}{t+ita}{t+bol}{t+bolit}{t+sc}{t+sl}
\postscript@fontdef{Iso-Times}{iso-times}{iso-t+rom}{iso-t+ita}{iso-t+bol}{iso-t+bolit}{iso-t+sc}{iso-t+sl}
%%
%%
% and finally we set up two command \adobeencoding, and \texencoding,
%% which we can choose depending on which we way we use PostScript
%% fonts
%%
\def\texencoding{\input{encoding.tex}}
\def\adobeencoding{\input{encoding.adobe}}
\def\romanfont#1{\renewcommand{\rmdefault}{#1}\rm}
\def\sansfont#1{\renewcommand{\sfdefault}{#1}\rm}
\def\typewriterfont#1{\renewcommand{\ttdefault}{#1}\rm}
\endinput