STIX 2.0 font declaration

[For your convenience: You can download STIX v2.0.0 from GitHub]

You don’t have to change anything because the release does not include optical sizes. The new ssty feature which offers special sub- and superscript glyphs is selected automatically by unicode-math. See the release notes:

WHAT IS NEW IN THIS RELEASE?

In addition to the overall visual redesign, STIX Two incorporates a
number of significant improvements and additions.  Special attention
has been given to implementing accepted best practices for OpenType
fonts, such as the use of font features to access variant glyph shapes
that were previously only available via the Unicode Private Use Areas.

The letterspacing and kerning of the text fonts have been
significantly improved.

True small capital variants (Latin, Cyrillic, and Greek), accessible
via the OpenType font feature smcp, have been added for all text
fonts.

Text (lowercase or oldstyle) numerals, available via the font features
pnum and onum, have been added, in addition to natural-spacing
figures.

Alphabetic superscripts and numeric sub- and superscripts, accessible
via the subs and sups font features, have been added.

Fractions are available via the frac feature, as well as numerators
(numr) and denominators (dnom).

The OpenType MATH table has been completely rewritten and extended.

Additions have been made to these Unicode blocks:
    Latin-1 Supplement          U+0080 - U+00FF
    Latin Extended-A            U+0100 - U+017F
    Latin Extended Additional   U+0180 - U+024F
    Cyrillic                    U+0400 - U+04FF
    Greek and Coptic            U+0370 - U+03FF
    IPA blocks                  U+0250 - U+02AF

Full details of included glyphs and supported font features are
available in the included spreadsheet.

Addendum: As pointed out by Khaled and misinterpreted by me, there are some optical sizes available in STIX2 which were not present in STIX1, namely for sub- and superscripts in math mode. I misinterpreted this because for me optical sizes means the Adobe definition of optical size. In addition to Khaled’s answer here is a snippet showing the difference for sub- and superscripts in math mode while showing that there is no difference in text mode.

\documentclass{article}
\usepackage{unicode-math}
\setmainfont{STIX2Text-Regular.otf}
\setmathfont{STIX2Math.otf}
\begin{document}

\setbox0=\hbox{$abc$}
\resizebox{!}{\ht0}{\copy0}

\resizebox{!}{\ht0}{$\scriptstyle abc$}

\resizebox{!}{\ht0}{$\scriptscriptstyle abc$}

\setbox0=\hbox{abc}
\resizebox{!}{\ht0}{\copy0}

\resizebox{!}{\ht0}{\scriptsize abc}

\resizebox{!}{\ht0}{\tiny abc}

\end{document}

enter image description here


You don’t need to do any thing to get the optical sizes included in the math font. They are associated with the ssty feature which unicode-math will enable it for script and scriptscript font sizes.