After discovering the magic of microtype, I've decided to switch to LuaLaTeX from XeLaTeX for a large document. Unfortunately, I'm having some difficulties mimicking my mathspec practices from the prior engine; the desired font is Alegreya. Here's what I'm trying to fix:
Music accidentals (
$\flat \sharp \natural$) should all be the standard Computer Modern glyphs. I clarify this because, as shown in the MWE, I'm also using thelilyglyphspackage.All superscript and subscript numbers should be Alegreya (with old-style numbers). This is easy enough with
amsmath's\textin math-mode, but I use it so often I'd like to make it the default.Letters in math mode (
$x$, for instance) should be Alegreya italic.
I've experimented with some unicode-math fixes, but I can't seem to get what I'm looking for.
MWE:
%LuaLaTeX
\documentclass{report}
\usepackage[T1]{fontenc}
\usepackage[osf]{Alegreya}
\usepackage{amsmath} %% \text in math mode
%\usepackage{unicode-math}
%\setmathfont[]{Alegreya} %% option range=0048-0057 ?
\let\origflat\flat %% this is included just in case; I use lilyglyphs but not its sharp, flat, or natural
\let\origsharp\sharp
\let\orignatural\natural
\usepackage{lilyglyphs}
\let\flat\origflat
\let\sharp\origsharp
\let\natural\orignatural
\begin{document}
$x$ and $y$ %% should be Alegreya italic
$\flat \sharp \natural$ % should all be standard CM
$^5_3$ %% should be Alegreya, old-style numbers
\end{document}

[italic]option formathastext, but this is terrific, thanks! – Richard Jul 04 '16 at 08:32