From: Robert K. <rk...@uc...> - 2004-10-27 23:51:00
|
John Hunter wrote: > Awesome - impressive work for an afternoon. Thanks for pointing me to > that dvi specification reference. I was trying to discern the format > from TeX: The Program, which despite its literate style, was less > accessible than the reference you pointed to. It is painful, though, > as you say, no matter how you slice it. > > Funny that I missed tftopl in my hunt for a parser, which was sitting > right on my system the whole time. I know how you feel. *Believe* me. In any case, please use tftopl. I'm pretty sure there's a bug in how tfm.py reads the fixed-point values, but I'm giving up in favor of tftopl. > In order to use this information in mathtext, we have reconstruct the > mapping from TeX symbol name to font and character number for each of > the tex symbols we use (cmr10, cmi10, cmex10 and cmsy10) . Currently > mathtext hardcodes the mapping from tex name to bakoma > fontname/number. > > A better approach would be to use either the mathml or unicode number > as the internal code for each symbol, and then provide mappings from > these to the tfm fontname/charnum and to the corresponding tex symbol > names - my guess is that this has already been done and we just have > to dig it up. Does http://www.dessci.com/fr/support/tech/encodings/font_enc.stm help? > Then we could use any of the fonts (Wolfram, Design Science, Symbol, > AMS, Bakoma) at http://www.mozilla.org/projects/mathml/fonts/encoding > for matplotlib mathtext, since the mapping from mathml/unicode to > fontname/charnum already exists on pages like > http://www.mozilla.org/projects/mathml/fonts/encoding/cmr.html, and is > easily parsed (I already did this when I was working on PS mathtext > with type1 fonts before Paul had the bright idea of just embedding the > truetype fonts in the ps document and reusing what we already had. > > In summary, it would be nice to be able to readily go from tex name > <-> mathml/unicode name <-> fontname/charnum in a variety of files, > including at a minimum the bakoma ttf and the corresponding tfm files. > Got some images to process today <wink> > > Does this sound like the right approach to you? More or less. Converting from TeX encodings (which are arcane) to modern standards as soon as possible is almost certainly the best approach. -- Robert Kern rk...@uc... "In the fields of hell where the grass grows high Are the graves of dreams allowed to die." -- Richard Harter |