The following is a context adaption of this tex.SX question:
https://tex.stackexchange.com/questions/380262/left-right-problem-with-stix-math-two-when-small-applied-to-the-group-luala
The problem is that with the stix 2 math fonts, parentheses don't
grow in a font with active +ssty feature when using luatex with the
context based fontloader. (With xelatex everything is fine, harfbuzz
seems to do it as wanted).
Below are two examples: One a mix of plain and context, and one with
a (shortened) typescript definition from a posting some weeks ago.
In both cases the parenthese in the second exponent is too small (I
attach an image, but don't know if it will come through).
Imho the source of the problem is that the font contains
parenleft.ssty, parenright.ssty, parenleft.ssty2 and
parenright.ssty2 glyphs and these "wins" when the fontloader is
looking for variants. The glyphs are *not* in the vvariants-list of
the parentheses. Other delimiters are not affected.
[983731]={
["boundingbox"]={ 60, -205, 374, 787 },
["index"]=4286,
["name"]="parenleft.ssty",
["unicode"]=40,
["width"]=417,
}
%%%%%%%% plain + context example:
\starttext
\font\STIXMx=file:stix2math.otf:mode=base;script=math;language=DFLT;
at 10pt
\font\STIXMix=file:stix2math.otf:mode=base;script=math;language=DFLT;
at 9pt
\font\STIXMixssty=file:stix2math.otf:mode=base;script=math;language=DFLT;+ssty=0;
at 9pt
\font\STIXMv=file:stix2math.otf:mode=base;script=math;language=DFLT;
at 5pt
\textfont0=\STIXMx
\scriptfont0=\STIXMix
\scriptscriptfont0=\STIXMv
$\left({a\over b}\over {c\over d}\right)
a^{\left({a\over b}\over {c\over d}\right)}
$
\textfont0=\STIXMx
\scriptfont0=\STIXMixssty
\scriptscriptfont0=\STIXMv
$\left({a\over b}\over {c\over d}\right)
a^{\left({a\over b}\over {c\over d}\right)}
$
\stoptext
% with typescript definition
\unprotect
\starttypescriptcollection[Stix2]
\starttypescript [\s!serif] [Stix2] [\s!all]
\definefontsynonym
[Stix2Regular]
[file:STIX2Text-Regular.otf]
\definefontsynonym
[Stix2Bold]
[file:STIX2Text-Bold.otf]
\definefontsynonym
[Stix2Italic]
[file:STIX2Text-Italic.otf]
\definefontsynonym
[Stix2BoldItalic]
[file:STIX2Text-BoldItalic.otf]
\definefontsynonym[\s!Serif] [Stix2Regular]
[\s!features=\s!default]
\definefontsynonym[\s!SerifBold] [Stix2Bold]
[\s!features=\s!default]
\definefontsynonym[\s!SerifItalic] [Stix2Italic]
[\s!features=\s!default]
\definefontsynonym[\s!SerifBoldItalic] [Stix2BoldItalic]
[\s!features=\s!default]
\stoptypescript
\starttypescript [\s!math] [Stix2]
\definefontsynonym
[Stix2Math]
[file:STIX2Math.otf]
[features=math\mathsizesuffix]
\definefontsynonym [\s!MathRoman] [Stix2Math]
[\s!features={\s!math\mathsizesuffix,mathextra,stixtwo-math-feature},\s!designsize=\s!auto]
\stoptypescript
\starttypescript [Stix2]
\definetypeface [\typescriptone] [\s!rm] [\s!serif] [Stix2]
[\s!default]
\definetypeface [\typescriptone] [\s!mm] [\s!math] [Stix2]
[\s!default]
\stoptypescript
\stoptypescriptcollection
\protect
\setupbodyfont[Stix2]
\starttext
$\left({a\over b}\over {c\over d}\right)
a^{\left({a\over b}\over {c\over d}\right)}
$
\stoptext
--
Ulrike Fischer
http://www.troubleshooting-tex.de/
___________________________________________________________________________________
If your question is of interest to others as well, please add an entry to the
Wiki!
maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context
webpage : http://www.pragma-ade.nl / http://context.aanhet.net
archive : https://bitbucket.org/phg/context-mirror/commits/
wiki : http://contextgarden.net
___________________________________________________________________________________