~sbinet/star-tex

Re: Adding math unicode support

Details
Message ID
<CABDg7L77Nir0RcLQUeFz0_SfCZqu6D59QA9xabOBHDWODXzhkg@mail.gmail.com>
DKIM signature
missing
Download raw message
Hi Sebastian,

Thank you for this great package, it is really useful for
https://github.com/tdewolff/canvas which really needs a TeX formula
shaper.

While using the library, I came to the conclusion that only plain TeX
is supported, which inherently uses the Type1 fonts (Computer Modern)
of the original TeX distribution. While building a DIV to path
converter, I came across the need to format math symbols (such as
\sum) which would need a Type1 font interpreter. Something nicer would
be to support unicode-math so that a proper OpenType font can be used
(such as the newer Computer Modern, or Latin Modern, STIX, DejaVu,
...).

Right now, characters are indexed into the cmex10 font for example
which would need a Type1 interpreter to properly convert the DVI into
SVG/PDF/paths. It is not clear to me whether this needs to be fixed in
this library or whether anyone could pass the right commands to the
TeX machine to make this work. I see various ways forward:
- OpTeX, LaTeX, XeTeX all support the unicode-math package, this would
need to be accompanied with setting the fonts to Latin Modern for
example. It is not clear to me these packages work in plain TeX
- Convert the output DVI character indices into e.g. the cmex10 font
into unicode by find the mapping table (not sure where it is), and
then draw the corresponding character from the Latin Modern OpenType
font, but this supposes that both fonts contain identical characters
(and especially character widths)
- Build a Type1 font interpreter to draw the original glyph shapes,
but it would've been nice to let users choose their math font (such as
Latin Modern, STIX, DejaVu, ...)

Let me know if you have any ideas, and thanks for the excellent package!

Saludos cordiales,
Taco de Wolff
Reply to thread Export thread (mbox)