%D \module
%D   [       file=type-imp-source,
%D        version=2010.06.21,
%D          title=\CONTEXT\ Typescript Macros,
%D       subtitle=Adobe Source Fonts (https://fonts.google.com/),
%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.

\starttypescriptcollection[source]

    \definefontfeature[source-serif-slanted][slant=0.2]

    \starttypescript [\s!serif] [source] [\s!name]
        \setups[\s!font:\s!fallback:\s!serif]
        \definefontsynonym [\s!Serif]           [\s!file:SourceSerifPro-Regular]  [\s!features=\s!default]
        \definefontsynonym [\s!SerifBold]       [\s!file:SourceSerifPro-Bold]     [\s!features=\s!default]
      % \definefontsynonym [\s!SerifBold]       [\s!file:SourceSerifPro-Semibold] [\s!features=\s!default]
        \definefontsynonym [\s!SerifItalic]     [\s!file:SourceSerifPro-Regular]  [\s!features={\s!default,source-serif-slanted}]
        \definefontsynonym [\s!SerifBoldItalic] [\s!file:SourceSerifPro-Bold]     [\s!features={\s!default,source-serif-slanted}]
    \stoptypescript

    \starttypescript [\s!sans] [source] [\s!name]
        \setups[\s!font:\s!fallback:\s!sans]
      % \definefontsynonym [\s!Sans]           [\s!file:SourceSansPro-ExtraLight]       [\s!features=\s!default]
      % \definefontsynonym [\s!Sans]           [\s!file:SourceSansPro-Light]            [\s!features=\s!default]
        \definefontsynonym [\s!Sans]           [\s!file:SourceSansPro-Regular]          [\s!features=\s!default]
      % \definefontsynonym [\s!SansBold]       [\s!file:SourceSansPro-Semibold]         [\s!features=\s!default]
        \definefontsynonym [\s!SansBold]       [\s!file:SourceSansPro-Bold]             [\s!features=\s!default]
      % \definefontsynonym [\s!SansBold]       [\s!file:SourceSansPro-Black]            [\s!features=\s!default]
      % \definefontsynonym [\s!SansItalic]     [\s!file:SourceSansPro-ExtraLightItalic] [\s!features=\s!default]
      % \definefontsynonym [\s!SansItalic]     [\s!file:SourceSansPro-LightItalic]      [\s!features=\s!default]
        \definefontsynonym [\s!SansItalic]     [\s!file:SourceSansPro-Italic]           [\s!features=\s!default]
      % \definefontsynonym [\s!SansBoldItalic] [\s!file:SourceSansPro-SemiboldItalic]   [\s!features=\s!default]
        \definefontsynonym [\s!SansBoldItalic] [\s!file:SourceSansPro-BoldItalic]       [\s!features=\s!default]
      % \definefontsynonym [\s!SansBoldItalic] [\s!file:SourceSansPro-BlackItalic]      [\s!features=\s!default]
    \stoptypescript

    \starttypescript [\s!mono] [source] [\s!name]
        \setups[\s!font:\s!fallback:\s!mono]
      % \definefontsynonym [\s!Mono]     [\s!file:SourceCodePro-ExtraLight] [\s!features=\s!none]
      % \definefontsynonym [\s!Mono]     [\s!file:SourceCodePro-Light]      [\s!features=\s!none]
        \definefontsynonym [\s!Mono]     [\s!file:SourceCodePro-Regular]    [\s!features=\s!none]
      % \definefontsynonym [\s!MonoBold] [\s!file:SourceCodePro-Medium]     [\s!features=\s!none]
      % \definefontsynonym [\s!MonoBold] [\s!file:SourceCodePro-Semibold]   [\s!features=\s!none]
        \definefontsynonym [\s!MonoBold] [\s!file:SourceCodePro-Bold]       [\s!features=\s!none]
      % \definefontsynonym [\s!MonoBold] [\s!file:SourceCodePro-Black]      [\s!features=\s!none]
    \stoptypescript

    \starttypescript [\s!math][source][\s!name]
      % \loadfontgoodies[texgyre]
        \definefontsynonym[\s!MathRoman][file:texgyredejavu-math][\s!features={\s!math\mathsizesuffix,mathextra},\s!goodies=dejavu-math]
    \stoptypescript

    \starttypescript[source]
        \definetypeface [source] [\s!rm] [\s!serif] [source] [\s!default]
        \definetypeface [source] [\s!ss] [\s!sans]  [source] [\s!default]
        \definetypeface [source] [\s!tt] [\s!mono]  [source] [\s!default]
        \definetypeface [source] [\s!mm] [\s!math]  [source] [\s!default] % [\s!rscale=1.2]
    \stoptypescript

\stoptypescriptcollection


% \starttext
%
% \definetypescriptprefix [b:as:extralight][regular]
% \definetypescriptprefix [b:as:light]     [semibold]
% \definetypescriptprefix [b:as:regular]   [bold]
% \definetypescriptprefix [b:as:medium]    [bold]
% \definetypescriptprefix [b:as:semibold]  [black]
% \definetypescriptprefix [b:as:bold]      [black]
% \definetypescriptprefix [b:as:black]     [black]
%
% \doloopoverlist {,display,caption,smtext,subhead} {
%     \definetypescriptprefix [u:adobesource#1]  [#1]
%     \definetypescriptprefix [n:adobesource#1]  [-regular]
%     \definetypescriptprefix [i:adobesource#1]  [-it]
%     \definetypescriptprefix [b:adobesource#1]  [-\typescriptprefix{b:as:regular}]
%     \definetypescriptprefix [bi:adobesource#1] [-\typescriptprefix{b:as:regular}it]
%     \doloopoverlist {extralight,light,regular,medium,semibold,bold,black} {
%         \definetypescriptprefix [b:adobesource#1##1]  [-\typescriptprefix{b:as:##1}]
%         \definetypescriptprefix [bi:adobesource#1##1] [-\typescriptprefix{b:as:##1}it]
%     }
% }
%
% \starttypescript [adobesource,adobesourcedisplay,adobesourcelight,adobesourcedisplaylight]
%     %
%     \writestatus{Serif}          {file:sourceserif4 \typescriptprefix{u:\typescriptone} \typescriptprefix {n:\typescriptone}}
%     \writestatus{SerifBold}      {file:sourceserif4 \typescriptprefix{u:\typescriptone} \typescriptprefix {b:\typescriptone}}
%     \writestatus{SerifItalic}    {file:sourceserif4 \typescriptprefix{u:\typescriptone} \typescriptprefix {i:\typescriptone}}
%     \writestatus{SerifBoldItalic}{file:sourceserif4 \typescriptprefix{u:\typescriptone} \typescriptprefix{bi:\typescriptone}}
%     %
%     \definefontsynonym[Serif]          [file:sourceserif4\typescriptprefix{u:\typescriptone}\typescriptprefix{n:\typescriptone}.otf]
%     \definefontsynonym[SerifBold]      [file:sourceserif4\typescriptprefix{u:\typescriptone}\typescriptprefix{b:\typescriptone}.otf]
%     \definefontsynonym[SerifItalic]    [file:sourceserif4\typescriptprefix{u:\typescriptone}\typescriptprefix{i:\typescriptone}.otf]
%     \definefontsynonym[SerifBoldItalic][file:sourceserif4\typescriptprefix{u:\typescriptone}\typescriptprefix{bi:\typescriptone}.otf]
%     %
%     \definetypeface [\typescriptone] [rm] [serif] [\typescriptone] [default]
%     \definetypeface [\typescriptone] [ss] [sans]  [dejavu] [default]
%     \definetypeface [\typescriptone] [tt] [mono]  [dejavu] [default]
%     \definetypeface [\typescriptone] [mm] [math]  [dejavu] [default]
% \stoptypescript
%
% % \usetypescriptfile[adobesource]
%
% \usebodyfont[adobesource]
% \usebodyfont[adobesourcedisplay]
%
% \setupbodyfont[adobesource]
%
% % \starttext
%
% {\switchtobodyfont[adobesource]normal \it italic \bf bold \bi bolditalic}
%
% \startoverlay
%     {\switchtobodyfont[adobesource]this is a test}
%     {\red\switchtobodyfont[adobesourcedisplay]this is a test}
% \stopoverlay
%
% \startoverlay
%     {\switchtobodyfont[adobesource]\bf this is a test}
%     {\red\switchtobodyfont[adobesourcedisplay]\bf this is a test}
% \stopoverlay
%
% \stoptext
