# Re: PostScript font installation: my evolving tools...

Melissa O'Neill writes:
> Over the Christmas break, I've written two Perl modules, GlyphEncoding.pm
> and FontMetrics.pm that provide support for generating font metrics for
> use in TeX. Some might claim that in doing so, I've been yet another

congratulations. an excellent-sounding project

> have right now is the ability to combine the glyphs from several fonts,
> but no glyph faking yet -- I think I might well turn out to be ideologically
glyph *lying* may be important, viz changing the declared width of
characters?

> and haven't been able to figure out by myself. One is what the best way
> to calculate the font dimensions SPACE, STRETCH, SHRINK, and EXTRASPACE,
> since it seems to me that different utilities work out these parameters
> using different formulas, and none of them seemed to correspond to the

too right. this is a serious old chestnut. the values used by fontinst
at present derive from a fairly long and detailed argument back and
fourth a few years ago. Alan's initial values were too harsh, and
the final values were as a result of experimentation

> ... to figure out the value for SPACE and set STRETCH and SHRINK to
> $spacewidth * 3/5 and$spacewidth * 5/21 respectively, which from looking
> at the output (and not the code) of fontinst, seems to be the values
> fontinst uses. For comparison I've listed below the values used by
dont forget this is encoding-specific in fontinst. so 8r.mtx says

\ifisglyph{space}\then
\setint{interword}{\width{space}}
\else\ifisglyph{i}\then
\setint{interword}{\width{i}}
\else
\setint{interword}{333}
\fi\fi

\setint{fontdimen(3)}{\scale{\int{interword}}{600}}% interword stretch
\setint{fontdimen(4)}{\scale{\int{interword}}{240}}% interword shrink

so i am not sure your reverse-engineered values are right. its been a
long time since i understood this bit

> sidebearings to letters make a set of letters suitable for math (OML),
> but looking at zrmhax.mtx in the fontinst distribution didn't prove very
> useful. It just hardcodes a bunch of values, like this:
>
>     \shiftglyph{b}{0}{-25}{0}
>     \shiftglyph{d}{0}{25}{0}
>     \shiftglyph{f}{150}{0}{25}
>     \shiftglyph{g}{0}{-50}{0}
>
> ... which didn't seem a very satisfactory solution -- ideally I'd like to
> have an algorithm to do this.
I dont think Alan ever derived one, he just experimented until it
looked good

> If people are interested, I could put my preliminary code up on my web
> site so you can play with them... (be warned that you'd need a very
> recent Perl version before you can run my code).

i'd like to look sometime. i'd be interested in merging in my Perl
code from the psnfss stuff which manages checksums, etc, writes map
files etc.

sebastian