%D \module
%D   [       file=type-lucida-opentype,
%D        version=2011.05.18,
%D          title=\CONTEXT\ Typescript Macros,
%D       subtitle=Lucida Nova Opentype,
%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.

%D We recommend using the otf files. No suffix is added to the filenames because that
%D triggers some distributions to omit this file, which is a bit strange because in
%D quite some placed suffixes for non public stiff are used.

% NOTA BENE: class features and goodies get expanded!

\definefontfeature[mathlucida][copymathscripts=yes] % see lfg file

% \definefontfeature[mathlucida][mathlucida][ss04=yes] % now we swap

% \definefontfeature[mathlucida][ss03=yes]

\starttypescriptcollection[lucida-opentype]

    % \setupmathradical[\c!leftmargin=.05mq]% mathquad

    \pushglobalsetups
        \startsetups[\s!math:lucida]
            \setmathradicalparameter\c!leftmargin{.05mq}% mathquad
        \stopsetups
    \popglobalsetups

    \doifunknownfontfeature {lucida-math-bold} {\definefontfeature[lucida-math-bold][boldened][boldmath=yes]}

    \starttypescript [lucida,lucidaot,lucidadk,lucidaot-nt,lucida-nt]
%         \loadfontgoodies[lucida-opentype-math]
        \definetypeface [\typescriptone] [\s!rm] [\s!serif]       [\typescriptone] [\s!default] [\s!features=\s!default]
        \definetypeface [\typescriptone] [\s!ss] [\s!sans]        [\typescriptone] [\s!default] [\s!features=\s!default]
        \definetypeface [\typescriptone] [\s!tt] [\s!mono]        [\typescriptone] [\s!default] [\s!features=\s!none]
        \definetypeface [\typescriptone] [\s!hw] [\s!handwriting] [\typescriptone] [\s!default] [\s!features=\s!default]
        \definetypeface [\typescriptone] [\s!cg] [\s!calligraphy] [\typescriptone] [\s!default] [\s!features=\s!default]
        \definetypeface [\typescriptone] [\s!mm] [\s!math]        [\typescriptone] [\s!default]
        \quittypescriptscanning
    \stoptypescript

    \starttypescript [\s!serif] [lucida,lucidaot,lucidadk,lucidaot-nt,lucida-nt]
        \definefontsynonym [\s!Serif]            [\s!file:LucidaBrightOT]           [\s!goodies=lucida-text]
        \definefontsynonym [\s!SerifBold]        [\s!file:LucidaBrightOT-Demi]      [\s!goodies=lucida-text]
        \definefontsynonym [\s!SerifItalic]      [\s!file:LucidaBrightOT-Italic]    [\s!goodies=lucida-text]
        \definefontsynonym [\s!SerifBoldItalic]  [\s!file:LucidaBrightOT-DemiItalic][\s!goodies=lucida-text]
        \definefontsynonym [\s!SerifSlanted]     [\s!SerifItalic]
        \definefontsynonym [\s!SerifBoldSlanted] [\s!SerifBoldItalic]
    \stoptypescript

    \starttypescript [\s!sans] [lucida,lucidaot,lucidadk,lucidaot-nt,lucida-nt]
        \definefontsynonym [\s!Sans]            [\s!file:LucidaSansOT]
        \definefontsynonym [\s!SansBold]        [\s!file:LucidaSansOT-Demi]
        \definefontsynonym [\s!SansItalic]      [\s!file:LucidaSansOT-Italic]
        \definefontsynonym [\s!SansBoldItalic]  [\s!file:LucidaSansOT-DemiItalic]
        \definefontsynonym [\s!SansSlanted]     [\s!SansItalic]
        \definefontsynonym [\s!SansBoldSlanted] [\s!SansBoldItalic]
    \stoptypescript

    \starttypescript [\s!mono] [lucida,lucidaot,lucidaot-nt,lucida-nt]
        \definefontsynonym [\s!Mono]            [\s!file:LucidaSansTypewriterOT]
        \definefontsynonym [\s!MonoBold]        [\s!file:LucidaSansTypewriterOT-Bold]
        \definefontsynonym [\s!MonoItalic]      [\s!file:LucidaSansTypewriterOT-Oblique]
        \definefontsynonym [\s!MonoBoldItalic]  [\s!file:LucidaSansTypewriterOT-BoldOblique]
        \definefontsynonym [\s!MonoSlanted]     [\s!MonoItalic]
        \definefontsynonym [\s!MonoBoldSlanted] [\s!MonoBoldItalic]
    \stoptypescript

    \starttypescript [\s!mono] [lucidadk,lucidaot-nt,lucida-nt]
        \definefontsynonym [\s!Mono]            [\s!file:LucidaGrandeMonoDK]
        \definefontsynonym [\s!MonoBold]        [\s!file:LucidaGrandeMonoDK-Bold]
        \definefontsynonym [\s!MonoItalic]      [\s!file:LucidaGrandeMonoDK-Oblique]
        \definefontsynonym [\s!MonoBoldItalic]  [\s!file:LucidaGrandeMonoDK-BoldOblique]
        \definefontsynonym [\s!MonoSlanted]     [\s!MonoItalic]
        \definefontsynonym [\s!MonoBoldSlanted] [\s!MonoBoldItalic]
    \stoptypescript

    \starttypescript [\s!math] [lucida,lucida-nt,lucidaot,lucidaot-nt,lucidadk]
        \checkedmapfontsize[\typescripttwo][\s!script]      [.70]
        \checkedmapfontsize[\typescripttwo][\s!scriptscript][.50]
    \stoptypescript

    \starttypescript [\s!math] [lucida,lucidaot,lucidadk]
        \definefontsynonym [\s!MathRoman]     [\s!file:LucidaBrightMathOT]      [\s!features={\s!math\mathsizesuffix,mathlucida,lucida:mathextra,mathextra},\s!goodies=lucida-math]
      % \definefontsynonym [\s!MathRomanBold] [\s!file:LucidaBrightMathOT-Demi] [\s!features={\s!math\mathsizesuffix,mathlucida,mathextra},\s!goodies=lucida-math]
        \definefontsynonym [\s!MathRomanBold] [\s!file:LucidaBrightMathOT]      [\s!features={\s!math\mathsizesuffix,lucida-math-bold,mathlucida,lucida:mathextra,mathextra},\s!goodies=lucida-math]
    \stoptypescript

    \starttypescript [\s!math] [lucidaot-nt,lucida-nt]
        \definefontsynonym [\s!MathRoman]     [\s!file:LucidaBrightMathOT]      [\s!features={\s!math\mathsizesuffix,mathlucida,lucida:mathextra,mathextra}]
      % \definefontsynonym [\s!MathRomanBold] [\s!file:LucidaBrightMathOT-Demi] [\s!features={\s!math\mathsizesuffix,mathlucida,mathextra}]
        \definefontsynonym [\s!MathRomanBold] [\s!file:LucidaBrightMathOT]      [\s!features={\s!math\mathsizesuffix,lucida-math-bold,mathlucida,lucida:mathextra,mathextra}]
    \stoptypescript

    \starttypescript [\s!handwriting] [lucida,lucidaot,lucidadk,lucidaot-nt,lucida-nt]
        \definefontsynonym [\s!Handwriting] [\s!file:LucidaHandwritingOT]
    \stoptypescript

    \starttypescript [\s!calligraphy] [lucida,lucidaot,lucidadk,lucidaot-nt,lucida-nt]
        \definefontsynonym [\s!Calligraphy] [\s!file:LucidaCalligraphyOT]
    \stoptypescript

\stoptypescriptcollection

\endinput
