%D \module
%D   [       file=type-imp-punk,
%D        version=2020.01.17,
%D          title=\CONTEXT\ Typescript Macros,
%D       subtitle=Punk Again,
%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 Yet another look at punk.

\ifdefined\enablerandomvariants\else
    \useMPlibrary[punk]
\fi

\doifelse {\truefontname{Serif}} {unknown} {
    \writestatus{fonts}{you need to load a base bodyfont first}
    \endinput
} {
    % we're ok
}

\starttypescriptcollection[punk]

    \definefontfeature [punk]            [metapost={category=punk,preroll=punkpreroll}]
    \definefontfeature [punkrandom]      [metapost={category=punk,preroll=punkpreroll,variants=5}]
    \definefontfeature [punkbold]        [metapost={category=punk,preroll=punkpreroll,weight=2}]
    \definefontfeature [punkslanted]     [metapost={category=punk,preroll=punkpreroll,slant=.15}]
    \definefontfeature [punkboldslanted] [metapost={category=punk,preroll=punkpreroll,slant=.15,weight=2}]
    \definefontfeature [punkveryslanted] [metapost={category=punk,preroll=punkpreroll,slant=-.15}]
    \definefontfeature [punksqueezed]    [metapost={category=punk,preroll=punkpreroll,squeeze=.5}]
    \definefontfeature [punkextended]    [metapost={category=punk,preroll=punkpreroll,extend=1.3}]

    \definefontsynonym [punkbase]        [\truefontname{Serif}]

    \starttypescript [\s!serif] [punk]
        \definefontsynonym [\s!Serif]           [punkbase] [\s!features=punk]
        \definefontsynonym [\s!SerifSlanted]    [punkbase] [\s!features=punkslanted]
        \definefontsynonym [\s!SerifBold]       [punkbase] [\s!features=punkbold]
        \definefontsynonym [\s!SerifBoldSlanted][punkbase] [\s!features=punkboldslanted]
        \definefontsynonym [\s!SerifItalic]     [\s!SerifSlanted]
        \definefontsynonym [\s!SerifBoldItalic] [\s!SerifBoldSlanted]
    \stoptypescript

    \starttypescript [punk]
        \definetypeface [punk] [\s!rm] [\s!serif] [punk] [\s!default]
    \stoptypescript

\stoptypescriptcollection

