This is a common problem, but none of the several links I've followed address my issue. An MWE:
%XeLaTeX
\documentclass{standalone}
\usepackage[T1]{fontenc}
\usepackage[sfdefault]{AlegreyaSans}
%\usepackage{Alegreya} % this works fine!
\begin{document}
Test!
\end{document}
I get the error message:
! Undefined control sequence.
<argument> ... AlegreyaSansSC-\Alegreya@boldstyle
}, ItalicFeatures = { Smal...
l.151 {AlegreyaSans}
The control sequence at the end of the top line
of your error message was never \def'ed. If you have
misspelled it (e.g., `\hobx'), type `I' and the correct
spelling (e.g., `I\hbox'). Otherwise just continue,
and I'll forget about whatever was undefined.
! Undefined control sequence.
<argument> ... AlegreyaSansSC-\Alegreya@boldstyle
Italic },
l.151 {AlegreyaSans}
The control sequence at the end of the top line
of your error message was never \def'ed. If you have
misspelled it (e.g., `\hobx'), type `I' and the correct
spelling (e.g., `I\hbox'). Otherwise just continue,
and I'll forget about whatever was undefined.
Requested font "[AlegreyaSans-Regular.ttf]/OT" at 10.0pt
-> /usr/local/texlive/2016/texmf-dist/fonts/truetype/huerta/alegreya/AlegreyaSans-Regular.ttf
\g__fontspec_family_AlegreyaSans_int=\count124
Requested font "[AlegreyaSansSC-Regular.ttf]/OT" at 10.0pt
-> /usr/local/texlive/2016/texmf-dist/fonts/truetype/huerta/alegreya/AlegreyaSansSC-Regular.ttf
Requested font "[AlegreyaSans-Bold.ttf]/OT" at 10.0pt
-> /usr/local/texlive/2016/texmf-dist/fonts/truetype/huerta/alegreya/AlegreyaSans-Bold.ttf
Requested font "[AlegreyaSansSC-.ttf]/OT" at 10.0pt
-> font not found, using "nullfont"
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
!
! fontspec error: "font-not-found"
!
! The font "AlegreyaSansSC-" cannot be found.
What I don't understand is that, for instance, /usr/local/texlive/2016/texmf-dist/fonts/truetype/huerta/alegreya/AlegreyaSans-Regular.ttf
absolutely exists! Is it possible that there is a permissions issue preventing this file from being accessed?
I'm using TeXlive 2016 on Fedora 24; I don't have this problem on a Mac with TeXlive 2015; is this a bug of some kind?
AlegreyaSans.sty
; in some places\Alegreya@boldstyle
is used instead of\AlegreyaSans@boldstyle
.AlegreyaSans
has fixed the problem.