At the time of writing, there is no Unicode math font available which is sanserif across all of the range. There have been discussions about this (presentations and the like would benefit from availability, particularly for those people not in pure mathematics but using mathematical notation).
You don’t say what isn’t working, but [range={"0000-"FFFF}
is wrong. This will overwrite the entire Basic Multilingual Plane with a font that has no OpenType math table.
You almost certainly want to use \setmathfont{My Font italic}[range=it]
for italic math variables, or [range=up]
for upright, bfup
for bold upright, and bfit
for bold italic. (To use an upright font by default in math mode, load unicode-math
with the [math-style=upright]
option.)
You might need to add the font options for the Italic face, such as optical sizes. Either add them as options along with range, or use \defaultfontfeatures{My Font Italic}
.
Update
Based on your comment, you want something like (untested)
\setmathfont{SourceSerif4-It}[
range=it,
SizeFeatures={
{Size={-9.5}, Font=SourceSerif4SmText-It},
{Size={9.5-}, Font=SourceSerif4-It}
},
Extension=.otf]
The other options are irrelevant to math mode. The default font for math variables is \symit
, not upright. If you also want to use \symup
or \usepackage[math-style=upright]{unicode-math}
, you would declare a corresponding command for range=up
. If you are using bold for vectors, you might want to set a command for range=bfit
or range=bfup
as well.
Best Answer
For reasons that I find very mysterious, Unicode has the full range of Greek in sans serif bold, upright and italic, but it doesn't cover sans serif Greek in medium weight; to wit, there are
and the other Greek letters (upper and lower case), but no medium weight ones.
So it's not surprising that
\symsf{\Gamma}
(or\mathsf{\Gamma}
in an older version ofunicode-math
) gives no different symbol: there's none that satisfies the request.You can get through with
\textsf
:A kludge, I know, but I can't offer any better. Of course the sans serif font defined in the document should support Greek.