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

Re: A question about spacing

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
   \setint{fontdimen(3)}{0}                           % interword
   \setint{fontdimen(4)}{0}                           % interword shrink
   \setint{fontdimen(3)}{\scale{\int{interword}}{600}}% interword
   \setint{fontdimen(4)}{\scale{\int{interword}}{240}}% interword shrink
\setint{fontdimen(5)}{\int{xheight}}                  % x-height
\setint{fontdimen(6)}{1000}                           % quad
   \setint{fontdimen(7)}{\int{interword}}             % extra space
after .
   \setint{fontdimen(7)}{\scale{\int{interword}}{240}}% extra space
after .

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:

      \setint{fontdimen(3)}{\int{stretchword}}% interword stretch
      \setint{fontdimen(3)}{\scale{\int{interword}}{600}}% interword

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:


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}}
   \ifisint{shrinkword}  \then \setint{fontdimen(4)}{\int{shrinkword}} 
   \ifisint{extraspace}  \then \setint{fontdimen(7)}{\int{extraspace}} 

and read it in at the appropriate place, eg:


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