%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%% FontStyles/palatino-linotype.sty
%% NOVA thesis configuration file
%%
%% Customization of font to use a Palatino-like font style
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

\typeout{NT FILE FontStyles/palatino-linotype.sty}%


%%=======================================================================
%% ENGINE CHECK
%%=======================================================================

\NTRequireEngine{style/font=palatino-linotype}{lua,xe}


%%=======================================================================
%% FONT SELECTION
%%=======================================================================

\IfFontExistsTF{Palatino Linotype}{%
  \setmainfont{Palatino Linotype}[
    Scale=1.0,
    Ligatures={Common,Discretionary,TeX}
  ]
  \renewcommand*{\FontPrettyName}{Palatino Linotype}
  % Use TeX Gyre Heros for sans (compatible with Palatino)
  \setsansfont{TeX Gyre Heros}[
    Scale=0.92,
    Ligatures=TeX
  ]
  \renewcommand*{\FontPrettyNameSans}{TeX Gyre Heros}
  % Use Courier New for mono
  \setmonofont{Courier New}[
    Scale=0.95,
    Ligatures=TeX
  ]
  \renewcommand*{\FontPrettyNameMono}{Courier New}
  % Math font using newtxmath with palatino
  \RequirePackage[p]{newtxmath}
  \renewcommand*{\FontPrettyNameMath}{Palatino (newtxmath)}
}{%
  \PackageError{novathesis}{'Palatino Linotype' font not found. Please select another font style in '0-Config/1_novathesis.tex'}{}
}
