Skip to content

Commit cb64f9e

Browse files
OmikhleiaDidier Willis
authored andcommitted
fix(math): Script 'math' is needed for the ssty feature to work properly
So that primes etc. use the correct glyphs. Libertinus Math v7.051 does not require it, but STIX Two Math 2.13 b171 and TeX Gyre Termes Math v1.543 do, for instance.
1 parent 4ff5c60 commit cb64f9e

2 files changed

Lines changed: 7 additions & 2 deletions

File tree

packages/math/base-elements.lua

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -214,6 +214,11 @@ function elements.mbox:_init ()
214214
size = SILE.settings:get("math.font.size"),
215215
style = SILE.settings:get("math.font.style"),
216216
weight = SILE.settings:get("math.font.weight"),
217+
-- https://learn.microsoft.com/en-us/typography/opentype/spec/math#opentype-layout-tags-used-with-the-math-table
218+
-- "Script tag to be used for features in math layout.
219+
-- The only language system supported with this tag is the default language system."
220+
-- Thus, needed for the ssty feature in superscript/subscript to work properly.
221+
script = "math",
217222
}
218223
local filename = SILE.settings:get("math.font.filename")
219224
if filename and filename ~= "" then

packages/math/init.lua

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -145,8 +145,8 @@ If required, you can set the font style and weight via \autodoc:setting{math.fon
145145
The font size can be set via \autodoc:setting{math.font.size}.
146146
The \autodoc:setting{math.font.script.feature} setting can be used to specify OpenType features for the math font, which are applied to the smaller script styles.
147147
It defaults to \code{ssty} (script style alternates), notably to ensure that some symbols such as the prime, double prime, etc. are displayed correctly.
148-
The default setting applies to Libertinus Math and well-designed math fonts, but some fonts may require different features.
149-
(The STIX Two Math font has a stylitic set \code{ss04} from primes only, but also supports, according to its documentation, \code{ssty}, which provides other optical adjustments.)
148+
The default setting applies to Libertinus Math, STIX Two Math, TeX Gyre Termes Math, and all well-designed math fonts, but some fonts may require different features.
149+
(The STIX Two Math font has a stylitic set \code{ss04} from primes only, but also supports \code{ssty} with additional optical adjustments.)
150150
151151
\paragraph{MathML}
152152
The first way to typeset math formulas is to enter them in the MathML format.

0 commit comments

Comments
 (0)