%D \module
%D   [       file=type-imp-minion,
%D        version=2016.06.14,
%D          title=\CONTEXT\ Typescript Macros,
%D       subtitle=Minion,
%D         author=Hans Hagen,
%D           date=\currentdate,
%D      copyright={PRAGMA ADE \& \CONTEXT\ Development Team}]
%C
%C This module is part of the \CONTEXT\ macro||package and is
%C therefore copyrighted by \PRAGMA. See mreadme.pdf for
%C details.

% \definefontfallback[MinionMathFallback]    [file:latinmodern-math.otf][uppercasescript]
% \definefontfallback[MinionBoldMathFallback][file:latinmodern-math.otf][uppercasescript]

% \definefontfeature[minion:mathhack] [kern={script=dflt,language=dflt}]
% \definefontfeature[minion:mathextra][kern={script=dflt,language=dflt}] % issues message
%
% \setupbodyfont[minion]
%
% \starttext
%     $ff$
% \stoptext
%
% Watch out: [kern=always] won't work here as that is an node mode trick. This is actually not something
% that one should use. It's for Mikael and Hans eyes only because they wanted t check the engine.

\starttypescriptcollection[minion]

    \starttypescript [\s!serif][minion][\s!all]
        \loadfontgoodies[minion]
        \definefontsynonym[\s!Serif]          [Minion-Regular]   [\s!features=\s!default,\s!goodies=minion]
        \definefontsynonym[\s!SerifBold]      [Minion-Bold]      [\s!features=\s!default,\s!goodies=minion]
        \definefontsynonym[\s!SerifItalic]    [Minion-Italic]    [\s!features=\s!default,\s!goodies=minion]
        \definefontsynonym[\s!SerifBoldItalic][Minion-BoldItalic][\s!features=\s!default,\s!goodies=minion]
    \stoptypescript

    \starttypescript [\s!serif][minion-medium][\s!all]
        \loadfontgoodies[minion]
        \definefontsynonym[\s!Serif]          [Minion-Regular]     [\s!features=\s!default,\s!goodies=minion]
        \definefontsynonym[\s!SerifBold]      [Minion-Medium]      [\s!features=\s!default,\s!goodies=minion]
        \definefontsynonym[\s!SerifItalic]    [Minion-Italic]      [\s!features=\s!default,\s!goodies=minion]
        \definefontsynonym[\s!SerifBoldItalic][Minion-MediumItalic][\s!features=\s!default,\s!goodies=minion]
    \stoptypescript

    \starttypescript [\s!math][minion][\s!all]
        \loadfontgoodies[minion]
        \loadfontgoodies[minion-math]
        \definefontsynonym[\s!MathRoman]    [Minion-Math]    [\s!features={minion:mathhack,\s!math\mathsizesuffix,minion:mathextra,mathextra},\s!designsize=\s!auto,\s!goodies=minion-math] % ,\s!fallbacks=MinionMathFallback]
        \definefontsynonym[\s!MathRomanBold][Minion-BoldMath][\s!features={minion:mathhack,\s!math\mathsizesuffix,minion:mathextra,mathextra},\s!designsize=\s!auto,\s!goodies=minion-math] % ,\s!fallbacks=MinionBoldMathFallback]
    \stoptypescript

    \starttypescript [\s!math][minion-medium][\s!all]
        \loadfontgoodies[minion]
        \loadfontgoodies[minion-math]
        \definefontsynonym[\s!MathRoman]    [Minion-Math]      [\s!features={minion:mathhack,\s!math\mathsizesuffix,minion:mathextra,mathextra},\s!designsize=\s!auto,\s!goodies=minion-math] % ,\s!fallbacks=MinionMathFallback]
        \definefontsynonym[\s!MathRomanBold][Minion-MediumMath][\s!features={minion:mathhack,\s!math\mathsizesuffix,minion:mathextra,mathextra},\s!designsize=\s!auto,\s!goodies=minion-math] % ,\s!fallbacks=MinionBoldMathFallback]
    \stoptypescript

    \starttypescript [minion,minion-medium]
        \definetypeface [\typescriptone] [\s!rm] [\s!serif] [\typescriptone] [\s!default]
        \definetypeface [\typescriptone] [\s!ss] [\s!sans]  [dejavu]         [\s!default] [\s!rscale=0.8]
        \definetypeface [\typescriptone] [\s!tt] [\s!mono]  [dejavu]         [\s!default] [\s!rscale=0.8]
        \definetypeface [\typescriptone] [\s!mm] [\s!math]  [\typescriptone] [\s!default]
    \stoptypescript

\stoptypescriptcollection
