-
-
Notifications
You must be signed in to change notification settings - Fork 1.5k
Description
Description
Currently, the main way to insert calligraphic variants of Latin letters in math is through the math.cal function.
There are two styles of calligraphic letters: roundhand (also known as "script"; \mathscr in LaTeX), and chancery (\mathcal in LaTeX). Unicode provides a single codepoint for each calligraphic letter, and it is up to the font to decide which style to use.
Some fonts may provide the other style as a stylistic set, but this is not standardized, and therefore cannot be used by default by Typst. Notwithstanding, Unicode provides a way to specify a style to use through standardized variation sequences for capital non-bold letters.12 Sadly, this feature is not supported by many fonts. This issue mainly focuses on tracking font support for chancery and roundhand style calligraphic variation sequences. Discussions can happen in the Math forge on Discord, and specific proposals can be submitted as separate issues.
Use Case
Being able to easily typeset documents requiring the use of both calligraphic styles using Typst.
Font support
Font support can be tested using the following piece of code:
#set text(font: "..")
\u{2112} \u{2112}\u{FE00} \u{2112}\u{FE01}The first L should be of either style (for math fonts, this is typically chancery); the second one should be chancery; the third one should be roundhand.
Below is a list of mathematical fonts with relevant information. As an indication, I believe it should be trivial for fonts that already have both glyph styles (typically, one of them accessible through a stylistic set as mentioned above). For other fonts, they have to create new glyphs, which requires some work.
- Cambria Math (tested with version 6.99, which seems to be the latest version as of writing this3)
- Fira Math
- Does not support calligraphic letters at all.
- More alphabets firamath/firamath#14
- IBM Plex Math
- Lete Sans Math
- Does not support all mathematical characters, so variation sequences are probably not the priority.
- Add support for mathematical variation sequences abccsss/LeteSansMath#15
- Libertinus Math
- Luciole Math
- Does not even support lower case calligraphic letters.
- New Computer Modern Math
- Support for chancery variation sequences added in 7.04, which should be bundled with the next Typst version.
- Noto Sans Math
- STIX Two Math
Open questions
- Should we add native support for this Unicode feature even though most math fonts don't support it for now? This could indicate to the maintainers of those fonts that there is demand for this feature. But at the same time, we would likely get complaints from users that the function does not work. The extreme lack of font support should be clearly documented.
- The latest version of New Computer Modern Math, Typst's default math font, now supports chancery variation sequences, so at least the function will work as expected with the default settings.
- Either way, as noted on Discord, support for variation sequences in math might be missing "because its multiple characters and so ends up going through the normal text layout."
- Solved by Use the shaper in math #6336.