A question about spacing

Alan Jeffrey ajeffrey@cs.depaul.edu
Tue, 02 Jun 1998 19:18:02 -0500


Rebecca and Rowland wrote:

> >_Someone_ should perhaps ask Alan Jeffrey why fontinst changes the font
> >dimens.

Hmm, perhaps this is a bug...  The relevant bit is in (O)T1.etx which
sets the fontdimens to be:

\comment{\section{Default font dimensions}}

\setint{fontdimen(1)}{\int{italicslant}}              % italic slant
\setint{fontdimen(2)}{\int{interword}}                % interword space
\ifisint{monowidth}\then
   \setint{fontdimen(3)}{0}                           % interword
stretch
   \setint{fontdimen(4)}{0}                           % interword shrink
\else
   \setint{fontdimen(3)}{\scale{\int{interword}}{600}}% interword
stretch
   \setint{fontdimen(4)}{\scale{\int{interword}}{240}}% interword shrink
\fi   
\setint{fontdimen(5)}{\int{xheight}}                  % x-height
\setint{fontdimen(6)}{1000}                           % quad
\ifisint{monowidth}\then
   \setint{fontdimen(7)}{\int{interword}}             % extra space
after .
\else
   \setint{fontdimen(7)}{\scale{\int{interword}}{240}}% extra space
after .
\fi

So it ignores the values of stretch, shrink, etc. from any PL files
which were read in.

Unfortunately, I think we're stuck with it, because if we changed the
appropriate lines to:

   \ifisint{stretchword}\then
      \setint{fontdimen(3)}{\int{stretchword}}% interword stretch
   \else
      \setint{fontdimen(3)}{\scale{\int{interword}}{600}}% interword
stretch
   \fi

and similarly for the others, then this means that any font which *at
any point* reads in a PL file will inherit the stretch & shrink from
that PL file.

For example, this means that if you build a full OT1-encoded font out of
Times Roman and CMR:

   \installfont{zptmcmr}
      {ptmr8a,psyr,latin,zrhax,kernoff,cmr10}
      {OT1}{OT1}{ptmcm}{m}{n}{}

then the values of stretch and shrink will end up coming from cmr10,
which is not what should happen!

I think this qualifies as a feature, not a bug, especially since it's
easy to code round (well, as easy as anything with fontinst is).  Just
create a file `dostretch.mtx' or similar, containing:

   \ifisint{stretchword} \then \setint{fontdimen(3)}{\int{stretchword}}
\fi
   \ifisint{shrinkword}  \then \setint{fontdimen(4)}{\int{shrinkword}} 
\fi
   \ifisint{extraspace}  \then \setint{fontdimen(7)}{\int{extraspace}} 
\fi

and read it in at the appropriate place, eg:

  
\installfont{ecorm0500}{ecrm0500,tcrm0500,dostretch}{T19}{T1}{cmor}{m}{n}{<5>}

Alan.
-- 
Alan Jeffrey,  Visiting Associate Professor, CTI, DePaul University, USA
Lecturer in Theoretical Computer Science, COGS, University of Sussex, UK
ajeffrey@cs.depaul.edu      alanje@cogs.susx.ac.uk       +1 312 362 8322