LaTeX math layout for Telegram Desktop in safe Rust.
The engine takes a TeX formula and returns its metrics and a flat list of
drawing calls. The host paints that list, with Qt in Telegram Desktop. The
engine crate forbids unsafe. The C ABI crate holds the only unsafe code,
and only what a C interface needs.
tmath is a port of MicroTeX, by way of our fork desktop-app/MicroTeX. For every formula it produces exactly what that fork produces. It carries MicroTeX's tables and built-in definitions, so MicroTeX's license notice is kept in NOTICE.
The C interface is include/tmath.h, built by the tmath-c
crate in ffi/. replay/tmath_replay.cpp paints the
display list with QPainter and measures text with Qt, making the calls
MicroTeX's Qt backend made, and
replay/tmath_fonts.qrc bundles the TeX fonts it
draws with. A host needs Qt and these files, no MicroTeX code.
See PLAN.md for the design and the milestones, and FIXES.md for the fork's fixes this replaces.
tmath is released under the MIT License.