However, in persistence mode, which is invoked by providing no output file it works as follows:
./mathtext
$x+y=2$
/tmp/tmpg0gkiX.mathtex.png
$xy=4$
/tmp/tmpCqTVBH.mathtex.png
Upon entering persistence mode mathtext waits for an equation on stdin; after an equation has been typed in it is rendered and the filename — generated automatically — is written to stdout. This not only makes batch processing of equations easier but also makes it a lot more convenient to use mathtex in another application.
Rather than having to spawn a new instance of ./mathtext every time you need to render an equation you instead can just launch a single instance and pipe equations to it. This is significantly faster than spawning a new instance.
The resulting equations remain in the systems temporary directory until the caller deletes them. Alternative file formats are available by using the -j flag.
Fantastic Work!!
ReplyDeleteWill this externilization allow it to be used in IronPython?
The code currently depends on a module called FT2Font. This is a wrapper around FreeType written in C++. If a .net equivalent could be written (same API, but using the .net font libraries) then yes, it could be used.
ReplyDeletevery nice,
ReplyDeleteThanks!