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

Re: A question about spacing



At 2:45 pm -0500 3/6/98, Alan Jeffrey wrote:
>Rebecca and Rowland wrote:
>
>> Right - this makes sense.  I take it that the various
>> stretch/shrink/extra-space parameters used are those set by the *first* pl
>> file?
>
>Yes, when pltomtx creates the .mtx file, it contains some \setint
>instructions, and these follow the usual `first definition wins'
>convention.

Right - thanks.

>> And I notice that the value of space is slightly different after fontinst
>> has waved its magic wand:
>>
>> --- ecorm1000.pl                --- ecrm1000.pl
>> (FONTDIMEN                      (FONTDIMEN
>>    (SLANT R 0.0)                   (SLANT R 0.0)
>>    (SPACE R 0.332996)              (SPACE R 0.333252)
>>
>> It's not a very big difference (0.08%).  Is this due to a rounding error
>> somewhere?
>
>Most likely yes.  The space value has to be converted into AFM units and
>back again.

Right - this makes sense.  I've just tried running fontinst on this file:

\input fontinst.sty

\installfonts
%
\installfamily{OT1}{cmrod}{\hyphenchar\font45 }
       \installfont {cmrod10} {cmr10, cmmi10,dostretch} {OT19}
                    {OT1} {cmrod}{m}{n} {<10> <10.95>}

\endinstallfonts
\bye

with dostretch.mtx containing the suggested code:

   \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


To test the `rounding error' hypothesis, I set the space in cmr10.pl to
0.75 (and don't tell Dr Knuth).  I ran fontinst, and converted cmrod10.vpl
to a tfm/vf pair using vptovf, and converted the resulting tfm file to a pl
file using tftopl.  This is the result:

cmr10.pl                                  cmrod10.pl
(FONTDIMEN                                (FONTDIMEN

   (SLANT R 0.0)                             (SLANT R 0.0)

   (SPACE R 0.75)                            (SPACE R 0.75)

   (STRETCH R 0.166667)                      (STRETCH R 0.45)

   (SHRINK R 0.111112)                       (SHRINK R 0.179993)

   (XHEIGHT R 0.430555)                      (XHEIGHT R 0.429993)

   (QUAD R 1.000003)                         (QUAD R 1.0)

   (EXTRASPACE R 0.111112)                   (EXTRASPACE R 0.179993)

   )                                         )

The space parameter is the same in both cases, but the  stretch, shrink,
and extraspace parameters are markedly different.

The minor differences in xheight and quad are most likely due to rounding
errors.

Does anyone have any idea what's going on?

Rowland.