views:

246

answers:

3

Hi!

If this is OT, please tell me where to repost it.

I need to render some math equations, in real time. Where can I find a mapping of the LaTeX "english" names (like \sum ) to symbol XYZ of ABC.ttf ? I can read + render ttf's fine; I just don't know where to get the ttfs that have the math symbols and how they're indexed.

Thanks!

+1  A: 

I've taken a look at the LaTeX mappings from symbol names to fonts and it's scary. LaTeX's fonts are more complicated than TTF to begin with, and the math fonts are the most complicated of the bunch. For starters, there are separate variants for the glyph depending on context: a big "\sum" in a formula is one character, but if you type "\sum" in inline math you get a different character optimized for inline formulas.

You might be better off using a Unicode database. You can download the Unicode database (as text files) from unicode.org, and there are also some libraries (IBM's LibICU?) which let you look up symbols by name. Most of the symbols you're looking for start at code point U+2200. This stuff doesn't give you nice looking formulas, just the symbols.

You might also be looking for a MathML renderer instead. This will give you the nice looking formulas (not as good as LaTeX), and has an XML interface which should be easy enough to work with.

Dietrich Epp
+1  A: 

I would look at Xetex. It allows unicode input, and allows one to use TTF fonts, so they must be doing exactly what you want to do. Or maybe you can even replace Latex with Xetex in whatever you're doing: then you wouldn't need to know the hairy details.

Alok
+1  A: 

I did not find such a list. But I compiled a similar list by hand. Look at my supersuer question where the AHK script provides a very partial map

Elazar Leibovich