% From mitthesis package
% Version: 1.00, 2023/06/17
% Documentation: https://ctan.org/pkg/mitthesis


%% TeX Gyre Heros (sans serif) text font with STIX Two Math font and Inconsolata monospaced font
%
% These fonts are available at: 
%				http://www.gust.org.pl/projects/e-foundry/tex-gyre 
%				https://github.com/stipub/stixfonts 
%				https://ctan.org/tex-archive/fonts/inconsolata
% Install these as system fonts on your computer
%
\ifpdftex
	\ClassWarning{mitnewthesis}{The heros-stix2 fontset requires a unicode engine. Defaulting to CMR fonts.}
	\RequirePackage[T1]{fontenc}
	\RequirePackage{bm}
\else
	\typeout{^^JTeX Gyre Heros (sans serif) text font with STIX2 math font and Inconsolata monospaced font.^^J}
	%
    \usepackage[warnings-off={mathtools-colon,mathtools-overbracket}]{unicode-math}
    % suppress tiresome warnings about lack of integration between mathtools and unicode-math
    % unicode-math loads the fontspec package

    \setmainfont{texgyreheros}[% Presumes these are system fonts! Available at: http://www.gust.org.pl/projects/e-foundry/tex-gyre
		WordSpace = {1,1.4,1},
		Extension = .otf,
    	UprightFont = *-regular,
    	ItalicFont = *-italic,
    	BoldFont = *-bold,
    	BoldItalicFont = *-bolditalic,
		Numbers = Lining,
    	Scale=0.91,
	]        
    \setsansfont{texgyreheros}[% Presumes these are system fonts! Available at: http://www.gust.org.pl/projects/e-foundry/tex-gyre
		WordSpace = {1,1.4,1},
		Extension = .otf,
    	UprightFont = *-regular,
    	ItalicFont = *-italic,
    	BoldFont = *-bold,
    	BoldItalicFont = *-bolditalic,
		Numbers = Lining,
    	Scale=0.91,
	]        
   \setmonofont{Inconsolatazi4}[% This otf font ships with the LaTeX Inconsolata package and is in CTAN https://ctan.org/tex-archive/fonts/inconsolata
        Scale=1.05,
        Extension = .otf,
        UprightFont = *-Regular,
        ItalicFont = *-Regular,% has no italic face
        BoldFont = *-Bold, 
    	BoldItalicFont = *-Bold,% has no bold italic face
        RawFeature = {+ss01,+ss02,+ss03},
    ]             
    \setmathfont{STIXTwoMath-Regular}[% nice glyphs, but \mkern sometimes needed %% https://github.com/stipub/stixfonts
    	Scale=MatchUppercase,
    	Extension = .otf,
		BoldFont = *,% STIX Two Math has no bold face
%       Color=NavyBlue, 
    	RawFeature = {+ss01, -ss02, -ss08},
    ]
    % ss01 -- switch calligraphic to script; +ss02 -- variants of g, u, v, w, z; +ss08 -- upright integrals
    %    
    \setmathfontface\mathbf{STIXTwoText-Bold.otf}[]% to not get Heros bold, https://github.com/stipub/stixfonts
    \setmathfontface\mathit{STIXTwoText-Italic.otf}[]
    \setmathfontface\mathrm{STIXTwoText-Regular.otf}[]% to get roman letters from STIX Two
     %         
    \newcommand*{\FRAC}[1]{{\addfontfeature{Fractions=On}#1}}% use OpenType feature for fractions, \FRAC{1/2} 
\fi
