%D \module
%D   [       file=type-imp-concrete,
%D        version=2022.30.09, % a bit older
%D          title=\CONTEXT\ Typescript Macros,
%D       subtitle=\TEX Gyre Fonts,
%D         author=Mikael Sundqvist,
%D           date=\currentdate,
%D      copyright={\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.

% lm is already preloaded so we can actually move this to lm

\starttypescriptcollection[concrete]

    %\definefontfeature[default-slanted-concrete][default][slant=.2]
    %\definefontfeature[none-slanted-concrete]   [none]   [slant=.2]

    \doifunknownfontfeature {concrete-math-bold} {\definefontfeature[concrete-math-bold][boldened]}
    \doifunknownfontfeature {concrete-text-bold} {\definefontfeature[concrete-text-bold][boldened-10]}

    % cmunorm cmunobx cmunoti cmunobi

    \starttypescript [\s!serif] [concrete]
        \definefontsynonym [\s!Serif]            [LMTypewriterVarWd-Regular]     [\s!features={\s!default,concrete-text-bold}]
        \definefontsynonym [\s!SerifBold]        [LMTypewriterVarWd-Dark]        [\s!features={\s!default,concrete-text-bold}]
        \definefontsynonym [\s!SerifItalic]      [LMTypewriterVarWd-Oblique]     [\s!features={\s!default,concrete-text-bold}]
        \definefontsynonym [\s!SerifSlanted]     [LMTypewriterVarWd-Oblique]     [\s!features={\s!default,concrete-text-bold}]
        \definefontsynonym [\s!SerifBoldItalic]  [LMTypewriterVarWd-DarkOblique] [\s!features={\s!default,concrete-text-bold}]
        \definefontsynonym [\s!SerifBoldSlanted] [LMTypewriterVarWd-DarkOblique] [\s!features={\s!default,concrete-text-bold}]
    \stoptypescript

    \starttypescript [\s!sans] [concrete]
        \definefontsynonym [\s!Sans]            [LMTypewriterVarWd-Regular]     [\s!features={\s!default,concrete-text-bold}]
        \definefontsynonym [\s!SansBold]        [LMTypewriterVarWd-Dark]        [\s!features={\s!default,concrete-text-bold}]
        \definefontsynonym [\s!SansItalic]      [LMTypewriterVarWd-Oblique]     [\s!features={\s!default,concrete-text-bold}]
        \definefontsynonym [\s!SansSlanted]     [LMTypewriterVarWd-Oblique]     [\s!features={\s!default,concrete-text-bold}]
        \definefontsynonym [\s!SansBoldItalic]  [LMTypewriterVarWd-DarkOblique] [\s!features={\s!default,concrete-text-bold}]
        \definefontsynonym [\s!SansBoldSlanted] [LMTypewriterVarWd-DarkOblique] [\s!features={\s!default,concrete-text-bold}]
    \stoptypescript

    \starttypescript [\s!mono] [concrete]
        \loadfontgoodies[lm]
        \definefontsynonym [\s!Mono]            [LMTypewriter-Regular]     [\s!features={\s!none,concrete-text-bold}]
        \definefontsynonym [\s!MonoBold]        [LMTypewriter-Dark]        [\s!features={\s!none,concrete-text-bold}]
        \definefontsynonym [\s!MonoItalic]      [LMTypewriter-Italic]      [\s!features={\s!none,concrete-text-bold}]
        \definefontsynonym [\s!MonoSlanted]     [LMTypewriter-Oblique]     [\s!features={\s!none,concrete-text-bold}]
        \definefontsynonym [\s!MonoBoldItalic]  [LMTypewriter-DarkOblique] [\s!features={\s!none,concrete-text-bold}]
        \definefontsynonym [\s!MonoBoldSlanted] [LMTypewriter-DarkOblique] [\s!features={\s!none,concrete-text-bold}]
   \stoptypescript

    \starttypescript [\s!math] [concrete]
        \checkedmapfontsize[\typescripttwo][\s!script]      [.76]
        \checkedmapfontsize[\typescripttwo][\s!scriptscript][.60]
    \stoptypescript

    \starttypescript [\s!math] [concrete] [\s!name]
        \loadfontgoodies[concrete-math]
        \definefontsynonym[\s!MathRoman]     [\s!file:Concrete-Math.otf] [\s!features={\s!math\mathsizesuffix,concrete:mathextra,mathextra},\s!goodies=concrete-math]
        \definefontsynonym[\s!MathRomanBold] [\s!file:Concrete-Math.otf] [\s!features={\s!math\mathsizesuffix,concrete-math-bold,concrete:mathextra,mathextra},\s!goodies=concrete-math]
    \stoptypescript

    \starttypescript [\s!math] [concrete-nt] [\s!name]
        \loadfontgoodies[concrete-math]
        \definefontsynonym[\s!MathRoman]     [\s!file:Concrete-Math.otf] [\s!features={\s!math\mathsizesuffix,concrete:mathextra,mathextra}]
        \definefontsynonym[\s!MathRomanBold] [\s!file:Concrete-Math.otf] [\s!features={\s!math\mathsizesuffix,concrete-math-bold,concrete:mathextra,mathextra}]
    \stoptypescript

    \starttypescript [concrete,concrete-nt]
        \definetypeface [\typescriptone] [\s!rm] [\s!serif] [concrete]       [\s!default]
        \definetypeface [\typescriptone] [\s!ss] [\s!sans]  [concrete]       [\s!default]
        \definetypeface [\typescriptone] [\s!tt] [\s!mono]  [concrete]       [\s!default]
        \definetypeface [\typescriptone] [\s!mm] [\s!math]  [\typescriptone] [\s!default]
        \quittypescriptscanning
    \stoptypescript

\stoptypescriptcollection
