[Fontinst] expanded fonts
Oliver Heins
olli@sopos.org
Mon, 16 Dec 2002 21:41:00 +0100
I want to use pdftex's feature of font expansion with Adobe's Stempel
Garamond font. For this, I have to provide tfm-files of the expanded
(virtual) fonts. E.g., when using pegr9d, I need metric files like
pegr9d+5.tfm, pegr9d+10.tfm, pegr9d+15.tfm, pegr9d+20.tfm, pegr9d-5.tfm,
pegr9d-10.tfm, pegr9d-15.tfm, pegr9d-20.tfm; and the same for all other
shapes in use, too. The +5 indicates, that the font is horizontally
stretched by 5/1000, the -15, that it is horizontally shrinked by
15/1000, etc.
This could be easily achieved when using afm2tfm:
afm2tfm pegr8a.afm -e 1.015 -T 8r.enc pegr8r+15.tfm
for example, produces the by 15/1000 horizontally expanded Roman encoded
with 8r.enc. Unfortunately, it seems to me to be nearly impossible to
produce with afm2tfm SC and OsF fonts. I tried fontinst, but failed --
mainly because I can't reproduce how the \latinfamily-macro works.
Adobe's Stempel Garamond consists beside the standard fonts of SC and
OsF fonts:
,----
| StempelGaramond-Roman StempelGaramond Roman
| StempelGaramond-Bold StempelGaramond Roman,BOLD
| StempelGaramond-Italic StempelGaramond Roman,ITALIC
| StempelGaramond-BoldItalic StempelGaramond Roman,BOLDITALIC
| StempelGaramond-RomanSC StempelGaramond RomanSC
| StempelGaramond-BoldOsF StempelGaramond RomanSC,BOLD
| StempelGaramond-ItalicOsF StempelGaramond RomanSC,ITALIC
| StempelGaramond-BoldItalicOsF StempelGaramond RomanSC,BOLDITALIC
`----
I renamed the afm- and pfb-files according to Berry's font-naming-scheme
to pegr8a.afm|pfb, pegb8a, pegri8a, pegbi8a, pegrc8a, pegbj8a, pegrij8a,
pegbij8a. (In fact, I was a little bit in doubt whether I should name
the OsF-fonts as OsF-fonts (j) or as SC-fonts (c), but decided to do it
the same way Walter Schmidt did.)
With the \latinfamily macro, it is very easy to produce all the (v)pl
and fd-files needed for normal typesetting, but (AFAIK) not these needed
for pdftex's font expansion feature.
My idea was to write a script that uses the low-level-commands of
fontinst and does in a first step, what \latinfamily does, and to extend
this script in a second step to produce the expanded fonts.
However, I failed in the first step. I read Ulrik Vieth's and Taco
Hoekwater's talk at the EuroTeX '99, and wrote the following script, but
it doesn't produce all necessary fonts. Especially, I don't know ho to
make the 9? encodings and the OsF-(virtual)fonts.
Thanks for your help,
olli
---------- schnipp ---------
\input fontinst.sty
\installfonts
% regular upright shape
\transformfont {pegr8r}{\reencodefont{8r}{\fromafm{pegr8a}}}
\installrawfont {pegr8r}{pegr8r,8r}{8r}{8r}{peg}{m}{n}{}
\installfont {pegr7t}{pegr8r,latin}{OT1}{OT1}{peg}{m}{n}{}
\installfont {pegr8t}{pegr8r,latin}{T1}{T1}{peg}{m}{n}{}
\installfont {pegr8c}{pegr8r,textcomp}{TS1}{TS1}{peg}{m}{n}{}
% regular italic shape
\transformfont {pegri8r}{\reencodefont{8r}{\fromafm{pegri8a}}}
\installrawfont {pegri8r}{pegri8r,8r}{8r}{8r}{peg}{m}{it}{}
\installfont {pegri7t}{pegri8r,latin}{OT1}{OT1}{peg}{m}{it}{}
\installfont {pegri8t}{pegri8r,latin}{T1}{T1}{peg}{m}{it}{}
\installfont {pegri8c}{pegri8r,textcomp}{TS1}{TS1}{peg}{m}{it}{}
% slanted shape faked
\transformfont {pegro8r}{\slantfont{167}{\frommtx{pegr8a}}}
\installrawfont {pegro8r}{pegro8r,8r}{8r}{8r}{peg}{m}{sl}{}
\installfont {pegro7t}{pegro8r,latin}{OT1}{OT1}{peg}{m}{sl}{}
\installfont {pegro8t}{pegro8r,latin}{T1}{T1}{peg}{m}{sl}{}
\installfont {pegro8c}{pegro8r,textcomp}{TS1}{TS1}{peg}{m}{sl}{}
% bold upright shape
\transformfont {pegb8r}{\reencodefont{8r}{\fromafm{pegb8a}}}
\installrawfont {pegb8r}{pegb8r,8r}{8r}{8r}{peg}{b}{n}{}
\installfont {pegb7t}{pegb8r,latin}{OT1}{OT1}{peg}{b}{n}{}
\installfont {pegb8t}{pegb8r,latin}{T1}{T1}{peg}{b}{n}{}
\installfont {pegb8c}{pegb8r,textcomp}{TS1}{TS1}{peg}{b}{n}{}
% bold italic shape
\transformfont {pegbi8r}{\reencodefont{8r}{\fromafm{pegbi8a}}}
\installrawfont {pegbi8r}{pegbi8r,8r}{8r}{8r}{peg}{b}{it}{}
\installfont {pegbi7t}{pegbi8r,latin}{OT1}{OT1}{peg}{b}{it}{}
\installfont {pegbi8t}{pegbi8r,latin}{T1}{T1}{peg}{b}{it}{}
\installfont {pegbi8c}{pegbi8r,textcomp}{TS1}{TS1}{peg}{b}{it}{}
% bold slanted shape faked
\transformfont {pegbo8r}{\slantfont{167}{\frommtx{pegr8a}}}
\installrawfont {pegbo8r}{pegbo8r,8r}{8r}{8r}{peg}{b}{sl}{}
\installfont {pegbo7t}{pegbo8r,latin}{OT1}{OT1}{peg}{b}{sl}{}
\installfont {pegbo8t}{pegbo8r,latin}{T1}{T1}{peg}{b}{sl}{}
\installfont {pegbo8c}{pegbo8r,textcomp}{TS1}{TS1}{peg}{b}{sl}{}
%% SC + OSF -- Regular
% small caps shape using SC+OsF fonts
\transformfont {pegrc8r}{\reencodefont{8r}{\fromafm{pegrc8a}}}
\installrawfont {pegrc8r}{pegrc8r,8r}{8r}{8r}{peg}{m}{sc}{}
\installfont {pegrc7t}{pegrc8r,latin}{OT1}{OT1}{peg}{m}{sc}{}
\installfont {pegrc8t}{pegrc8r,latin}{T1}{T1}{peg}{m}{sc}{}
\endinstallfonts
\bye
---------- schnipp ---------