[Haskell-cafe] design question/font metrics

Stephen Tetley stephen.tetley at gmail.com
Tue Jun 1 10:53:28 EDT 2010


Hi Gery

There probably isn't a library to help - I've looked at extracting
TrueType font metrics myself but abandoned it - TrueType fonts have a
very complicated file format, and the spec is inadequate to code an
implementation. TeX font metrics are probably simpler but obviously
tied to TeX.

Reading from file and being in IO is probably not so bad for a TeX
like program - as TeX is essentially a 'compiler' a function from Tex
to Dvi, i.e. compileFile :: TeX -> Dvi.

For any significant compiler you are likely to have the work inside a
monad made of a stack of monad transformers, so you can cleanly and
fairly trivially add IO as the bottom layer of the monad stack -
CompilerM - e.g. compileFile :: TeX -> CompilerM Dvi.


Best wishes

Stephen


More information about the Haskell-Cafe mailing list