mathjax / MathJax-src

MathJax source code for version 3 and beyond
https://www.mathjax.org/
Apache License 2.0
2.05k stars 205 forks source link

Add ability for extensions to set the SMP mappings for new variants #1062

Closed dpvc closed 7 months ago

dpvc commented 7 months ago

This PR provides a mechanism for font extensions to set the SMP remapping data for new variants that the extension defines. It also adds a new options section to the SmpData type that allows additional mappings, and uses that to set the extra mappings for the bold variant that were hard-coded into the remapSmpChars() method. Finally, it allows the SMP mapping for a new variant to be defined in terms of previous SMP mappings by specifying the string name of a variant whose mapping is the same. That way, fonts like dsfonts that is a double-struck font can simply specify that the double-struck mapping is to be used rather than duplicating the data for that.

dpvc commented 7 months ago

Viewing the file difference with whitespace changes hidden makes it easier to see the differences, since there are indentation changes due to an earlier return (I know you link those).