\begin{EDIT}{2018-05-17}
You might want to look at this answer going into detail about how best to use Neo Euler. One major thing to consider, is that Neo Euler hasn't been worked since 2011 and the github repo states
this project is abandoned, the repository is left for achælogical purposes
so I don't know if using Euler, AMS Euler or Neo Euler is still a good idea. You might want to leave the dead rest in peace and work with living fonts. Have a look at the latest version unicode-math
documentation to make a more educated decision as to how to best move on.
\end{EDIT}
The option Scale=MatchLowercase
works under XeLaTeX
. I have found by chance, that the "correct" way to do it is to follow Example 1 of the documentation:
\setmainfont{texgyrebonum-regular.otf}
\setsansfont{lmsans10-regular.otf}[Scale=MatchLowercase]
\setmonofont{Inconsolatazi4-Regular.otf}[Scale=MatchLowercase]
that is, not to set the Scale=MatchLowercase
as an argument in
\defaultfontfeatures{...}
but rather as an optional argument of the "secondary" fonts, which will then orient themselves to the main font, which has been set by \setmainfont{...}
Second (yeahr, I ain't mentioned 'first', get over it), from the fontspec
documentation, we get:
The fontspec package must also be loaded after any maths font packages (e.g., euler) to be successful. (Actually, it is only euler that is the problem.5)
5: Speaking of euler, if you want to use its [mathbf]
option, it won’t work, and you’ll need to put this after fontspec
is loaded instead: \AtBeginDocument{\DeclareMathAlphabet\mathbf{U}{eur}{b}{n}
Third, there seems to be a problem with Palatino Linotype
as main font, since the following code...
\documentclass{article}
\usepackage[math-style=upright]{unicode-math}
\setmathfont[Color={00D419},Scale=MatchLowercase]{ams-euler.otf}
\usepackage{fontspec}
\setmainfont{Palatino Linotype}
\setmonofont[Color={0019D4},Scale=MatchLowercase]{DejaVu Sans Mono}
\begin{document}
Upper case: $W$W{\tt W}
Lower case: $w$w{\tt w}
\end{document}
yields

but if I just change the font to, say Libertinus Serif
(I didn't test other ones), ...
\documentclass{article}
\usepackage[math-style=upright]{unicode-math}
\setmathfont[Color={00D419},Scale=MatchLowercase]{ams-euler.otf}
\usepackage{fontspec}
\setmainfont{Libertinus Serif}
\setmonofont[Color={0019D4},Scale=MatchLowercase]{DejaVu Sans Mono}
\begin{document}
Upper case: $W$W{\tt W}
Lower case: $w$w{\tt w}
\end{document}
we get nicely lowercase-matched types. It also works with MatchUppercase
.

PS: Could anyone enlighten me as to where \setromanfont
comes from? This term is nowhere to be found in the fontspec
documentation.
Scale=MatchLowercase
option doesn't work as expected under XeLaTeX. :-(