# Is there a way to use external font files with unicode-math?

I use fontspec with LuaLaTeX to load fonts from external file even if they are not installed on the system. Such as

\usepackage{fontspec}
\setmainfont[Path=fonts/,
Extension=.otf,
UprightFont=*-Regular,
ItalicFont=*-Italic,
BoldFont=*-Bold,
SmallCapsFont=*-AllSC,]{EBGaramond12}

I also use unicode-math, because it's awesome, usually with XITS Maths for the operators and numbers and EB Garamond for the letters.

\usepackage[math-style=TeX]{unicode-math}
\setmathfont{XITS Math}
\setmathfont[range=\mathbfsfit/{greek,Greek,latin,Latin}]{EB Garamond}

Is there a way to combine these packages to use the letters from the local EB Garamond instead of the system's one?

-
All fontspec options are valid for unicode-math as well. –  Khaled Hosny Jan 22 '13 at 14:54

Thanks to @Khaled Hosny, I have found out how to do it. It is not exactly true that all fontspec options are available for unicode-math. In this case, unicode-math doesn't seem to support the wildcard expansion feature of fontspec, so instead of

\setmathfont[
range=\mathbfsfit/{greek,Greek,latin,Latin}
Path=fonts/,
Extension=.otf,
UprightFont=*-Regular,
ItalicFont=*-Italic,
BoldFont=*-Bold]{EBGaramond12}

one has to use

\setmathfont[
range=\mathbfsfit/{greek,Greek,latin,Latin},
Path=fonts/,
Extension=.otf,
ItalicFont=EBGaramond12-Italic,
BoldFont=EBGaramond12-Bold]{EBGaramond12-Regular}
-