MathJax-src icon indicating copy to clipboard operation
MathJax-src copied to clipboard

Refactor some FontData properties, and allow specifying a FontData class rather than instance

Open dpvc opened this issue 4 years ago • 0 comments

This PR reorganizes some properties from the FontData object and its subclasses so that TeX-specific information is in the TeX font subclass, and the common data is in FontData. This includes:

  • Moving getDelimiterData() to the CHTML TeX font subclass.
  • Moving the -tex-* variants that are used by the TeX input jax into the common FontData so that they don't have to be repeated in every subclass.
  • Moving the MathJax-TeX-font specific remappings into the TeX font subclass (they aren't the same for STIX and other fonts).

In addition, the font option for the output jax is extended to allow the specification of a FontData class rather than just an instance. That simplifies the components that set up the fonts for CHTML and SVG, which used to have to create a font instance but now can just pass the font class.

Finally, the schar property in the delimiter data can now repeat its final value automatically (reducing the length of the array when a value is repeated multiple times, as is the case in a number of delimiters).

dpvc avatar Aug 18 '21 14:08 dpvc