%D \module
%D   [       file=type-otf,
%D        version=2007.07.30,
%D          title=\CONTEXT\ Typescript Macros,
%D       subtitle=Euler,
%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.

\loadtypescriptfile[texgyre]
\loadtypescriptfile[dejavu]

% U+0000 upto U+3100 is probably ok, but even then we don't want a mix of accented

\resetfontfallback  [euleroverpagella]
\resetfontfallback  [pagellaovereuler]

% 0x1D455 : italic h

\definefontfallback [euleroverpagella] [\s!file:euler.otf]   [0x02100-0x02BFF] [\s!check=yes,\c!force=yes]
\definefontfallback [euleroverpagella] [\s!file:euler.otf]   [0x1D400-0x1D7FF] [\s!check=yes,\c!force=yes]
\definefontfallback [euleroverpagella] [texgyrepagella-math] [0x0210E]         [\s!check=yes,\c!force=\v!yes]
%definefontfallback [euleroverpagella] [\s!file:euler.otf]   [0x1D538-0x1D550] [\s!check=yes,\c!force=yes]

\definefontfallback [pagellaovereuler] [texgyrepagella-math] [0x02100-0x02BFF] [\s!check=yes]
\definefontfallback [pagellaovereuler] [texgyrepagella-math] [0x1D400-0x1D7FF] [\s!check=yes]
\definefontfallback [pagellaovereuler] [texgyrepagella-math] [0x1D400-0x1D7FF] [\s!check=yes]
\definefontfallback [pagellaovereuler] [texgyrepagella-math] [0x0210E]         [\s!check=yes,\c!force=\v!yes]
%definefontfallback [pagellaovereuler] [texgyrepagella-math] [0x1D538-0x1D550] [\s!check=yes]

% example for aditya:

% \definefontfallback [pagellaovereuler] [texgyrepagella-math] [lowercasenormal] [offset=uppercasenormal,force=yes]
% \definefontfallback [pagellaovereuler] [texgyrepagella-math] [uppercasenormal] [offset=lowercasenormal,force=yes]

% \definefontfallback [pagellaovereuler] [texgyrepagella-math] [uppercasebolditalic] [force=yes]
% \definefontfallback [pagellaovereuler] [texgyrepagella-math] [lowercasebolditalic] [force=yes]

\starttypescriptcollection[pagella-eulernova]

    \starttypescript [\s!serif] [eulernova] [\s!name]
        \setups[\s!font:\s!fallback:\s!serif]
        \definefontsynonym [\s!Serif] [\s!file:euler.otf] [\s!features=\s!default]
    \stoptypescript

    \starttypescript [\s!math] [eulernova] [\s!name]
      % \loadfontgoodies[euler-math]
        \definefontsynonym [MathRoman] [\s!file:euler.otf] [\s!features={\s!math\mathsizesuffix,mathextra}]
    \stoptypescript

    \starttypescript [pagella-eulernova]
        \definetypeface [\typescriptone] [\s!rm] [\s!serif] [pagella]   [\s!default]
        \definetypeface [\typescriptone] [\s!tt] [\s!mono]  [dejavu]    [\s!default] [\s!rscale=0.9]
        \definetypeface [\typescriptone] [\s!mm] [\s!math]  [eulernova] [\s!default]
        \quittypescriptscanning
    \stoptypescript

    \starttypescript [eulernova]
        \definetypeface [\typescriptone] [\s!rm] [\s!serif] [eulernova] [\s!default]
        \definetypeface [\typescriptone] [\s!tt] [\s!mono]  [dejavu]    [\s!default] [\s!rscale=0.9]
        \definetypeface [\typescriptone] [\s!mm] [\s!math]  [eulernova] [\s!default]
        \quittypescriptscanning
    \stoptypescript

    \starttypescript [\s!math] [euleroverpagella] [\s!name]
        \definefontsynonym [MathRoman] [texgyrepagella-math] [\s!features={\s!math\mathsizesuffix,mathextra},\s!fallbacks=euleroverpagella]
    \stoptypescript

    \starttypescript [\s!math] [pagellaovereuler] [\s!name]
        \definefontsynonym [MathRoman] [\s!file:euler.otf] [\s!features={\s!math\mathsizesuffix,mathextra},\s!fallbacks=pagellaovereuler]
    \stoptypescript

    \starttypescript [pagella-with-euler]
        \definetypeface [\typescriptone] [\s!rm] [\s!serif] [pagella]          [\s!default]
        \definetypeface [\typescriptone] [\s!tt] [\s!mono]  [dejavu]           [\s!default] [\s!rscale=0.9]
        \definetypeface [\typescriptone] [\s!mm] [\s!math]  [euleroverpagella] [\s!default]
        \quittypescriptscanning
    \stoptypescript

    \starttypescript [euler-with-pagella]
        \definetypeface [\typescriptone] [\s!rm] [\s!serif] [eulernova]        [\s!default]
        \definetypeface [\typescriptone] [\s!tt] [\s!mono]  [dejavu]           [\s!default] [\s!rscale=0.9]
        \definetypeface [\typescriptone] [\s!mm] [\s!math]  [pagellaovereuler] [\s!default]
        \quittypescriptscanning
    \stoptypescript

\stoptypescriptcollection
