brucemiller / LaTeXML

LaTeXML: a TeX and LaTeX to XML/HTML/ePub/MathML translator.
http://dlmf.nist.gov/LaTeXML/
Other
961 stars 101 forks source link

Plain fonts #2411

Closed brucemiller closed 2 months ago

brucemiller commented 2 months ago

This PR gets most of the low-level font related commands better cooperating, in particular control sequences defined by \font are now represented by a FontDef which then will change to the font, and is also recognized by \the and \meaning, as well as the accessors \fontdimen, etc. These commands are also stored in \textfont,\scriptfont,\scriptscriptfont for use with \fam and the \mathcode mechanism to choose fonts for math tokens in a particularly interesting way, which now mostly works. Consequently most of plain.tex mostly works.

This mostly cooperates with the higher-level LaTeX style of font selection currently used by LaTeXML (by specifying family, shape, etc, w/o explicitly naming fonts or font files); later work will need to integrate these better.

brucemiller commented 2 months ago

Interesting pragmatic, if counter-intuitive, development: When alphanumerics appear in math, we've been keeping their content ASCII, but recording the (presumably semantic) styling, which gets dealt with appropriately by the post-processor. That's not so convenient for certain more exotic styles (Caligraphic, Blackboard bold) in text mode, where the style ultimately must be handled with CSS. This last set of commits makes this distinct handling more explicit and consistent, even when lower-level TeX commands such as \char are used.