Piet Tutelaers writes:
> In order to get a feeling for the effort needed to rewrite fontinst into
> PERL:
> (1) What exact role plays the .etx and .mtx files in the fontinst process?
The .etx files describe the font encoding, and the .mtx files describe
the metrics, in a TeX-friendly format. Both of them make heavy use of
TeX's macro language to provide control structures such as
if-statements and commands. For example the command which defines an
`unfakable' glyph (a black box with a `missing glyph' special) is:
\setcommand\unfakable#1{
\setglyph{#1}
\ifisglyph{#1-not}\then
\moveup{\neg{\depth{#1-not}}}
\glyphrule{
\width{#1-not}
}{
\add{\depth{#1-not}}{\height{#1-not}}
}
\resetitalic{\italic{#1-not}}
\moveup{\depth{#1-not}}
\else
\glyphrule{500}{500}
\fi
\glyphwarning{missing glyph `#1'}
\endsetglyph
}
> (2) Which parts can only be handled in TeX's mouth?
Fontinst does have a published API for the syntax of commands like
\setcommand, \ifisglyph etc. etc. but writing a parser and interpreter
for it would effectively mean reinventing TeX's mouth. One of the
reasons why it's implemented in TeX in the first place is to make use
of the macro language.
Fontinst itself is only ~2.5kLOC, but once you include all the .mtx
and .etx files which come with it it's ~12kLOC. Porting it would be a
major enterprise for not terribly much gain compared to using perl
scripts to postprocess fontinst output.
Alan.