% The file sdynamo.tex (C) Petr Olsak, Jun 2001, Feb 2004

% After "\input sdynamo", you can use
%
% \showfonts ... to show the loaded fontfamilies on terminal
% \fontusage ... to show the usage of new TeX macros on terminal 
%
% See stormtex.html an ofsdoc.tex manuals for more details.

\expandafter\ifx \csname ofs-sdynamo\endcsname\relax\else\endinput\fi
\expandafter\gdef\csname ofs-sdynamo\endcsname{}

\ifx \ofsdeclarefamily\undefined    \input ofs      \fi

\ofsputfamlist{^^Jsdynamo.tex:}

\ofsdeclarefamily [DynaGroteskDXE] {% -------- Dynamo Grotesk DXE
   \loadtextfam sdgd\fotenc v;%
                sdgc\fotenc v;%
                sdgdi\fotenc v;%
                sdgci\fotenc v;6s;%
   \modifyenc 8z:storm;%
   \modifyenc 8t:storm;%
}
\registerenc: 8z  \registerenc: 8t

\ofsdeclarefamily [DynaGroteskRXE] {% -------- Dynamo Grotesk RXE
   \loadtextfam sdgr\fotenc v;%
                sdgb\fotenc v;%
                sdgri\fotenc v;%
                sdgbi\fotenc v;6s;%
   \modifyenc 8z:storm;%
   \modifyenc 8t:storm;%
}
\registerenc: 8z  \registerenc: 8t

\ofsdeclarefamily [DynaGroteskLXE] {% -------- Dynamo Grotesk LXE
   \loadtextfam sdgl\fotenc v;%
                sdgd\fotenc v;%
                sdgli\fotenc v;%
                sdgdi\fotenc v;6s;%
   \modifyenc 8z:storm;%
   \modifyenc 8t:storm;%
}
\registerenc: 8z  \registerenc: 8t

\ofsdeclarefamily [DynaGroteskDE] {% --------- Dynamo Grotesk DE
   \loadtextfam sdgd\fotenc e;%
                sdgc\fotenc e;%
                sdgdi\fotenc e;%
                sdgci\fotenc e;6s;%
   \modifyenc 8z:storm;%
   \modifyenc 8t:storm;%
}
\registerenc: 8z  \registerenc: 8t

\ofsdeclarefamily [DynaGroteskRE] {% --------- Dynamo Grotesk RE
   \loadtextfam sdgr\fotenc e;%
                sdgb\fotenc e;%
                sdgri\fotenc e;%
                sdgbi\fotenc e;6s;%
   \modifyenc 8z:storm;%
   \modifyenc 8t:storm;%
}
\registerenc: 8z  \registerenc: 8t

\ofsdeclarefamily [DynaGroteskLE] {% --------- Dynamo Grotesk LE
   \loadtextfam sdgl\fotenc e;%
                sdgd\fotenc e;%
                sdgli\fotenc e;%
                sdgdi\fotenc e;6s;%
   \modifyenc 8z:storm;%
   \modifyenc 8t:storm;%
}
\registerenc: 8z  \registerenc: 8t

\ofsdeclarefamily [DynaGroteskD] {% ---------- Dynamo Grotesk D
   \loadtextfam sdgd\fotenc;%
                sdgc\fotenc;%
                sdgdi\fotenc;%
                sdgci\fotenc;6s;%
   \modifyenc 8z:storm;%
   \modifyenc 8t:storm;%
}
\registerenc: 8z  \registerenc: 8t

\ofsdeclarefamily [DynaGroteskR] {% ---------- Dynamo Grotesk R
   \loadtextfam sdgr\fotenc;%
                sdgb\fotenc;%
                sdgri\fotenc;%
                sdgbi\fotenc;6s;%
   \modifyenc 8z:storm;%
   \modifyenc 8t:storm;%
}
\registerenc: 8z  \registerenc: 8t

\ofsdeclarefamily [DynaGroteskL] {% ---------- Dynamo Grotesk L
   \loadtextfam sdgl\fotenc;%
                sdgd\fotenc;%
                sdgli\fotenc;%
                sdgdi\fotenc;6s;%
   \modifyenc 8z:storm;%
   \modifyenc 8t:storm;%
}
\registerenc: 8z  \registerenc: 8t

\ofsdeclarefamily [DynaGroteskDM] {% --------- Dynamo Grotesk DM
   \loadtextfam sdgd\fotenc n;%
                sdgc\fotenc n;%
                sdgdi\fotenc n;%
                sdgci\fotenc n;6s;%
   \def\TeX{T\kern-.1em\lower.5ex\hbox{E}\kern-.125emX}%
   \modifyenc 8z:storm;%
   \modifyenc 8t:storm;%
}
\registerenc: 8z  \registerenc: 8t

\ofsdeclarefamily [DynaGroteskRM] {% --------- Dynamo Grotesk RM
   \loadtextfam sdgr\fotenc n;%
                sdgb\fotenc n;%
                sdgri\fotenc n;%
                sdgbi\fotenc n;6s;%
   \modifyenc 8z:storm;%
   \modifyenc 8t:storm;%
}
\registerenc: 8z  \registerenc: 8t

\ofsdeclarefamily [DynaGroteskLM] {% --------- Dynamo Grotesk LM
   \loadtextfam sdgl\fotenc n;%
                sdgd\fotenc n;%
                sdgli\fotenc n;%
                sdgdi\fotenc n;6s;%
   \modifyenc 8z:storm;%
   \modifyenc 8t:storm;%
}
\registerenc: 8z  \registerenc: 8t

\ofsdeclarefamily [DynaGroteskDC] {% --------- Dynamo Grotesk DC
   \loadtextfam sdgd\fotenc c;%
                sdgc\fotenc c;%
                sdgdi\fotenc c;%
                sdgci\fotenc c;6s;%
   \def\TeX{T\kern-.09em\lower.5ex\hbox{E}\kern-.1emX}%
   \modifyenc 8z:storm;%
   \modifyenc 8t:storm;%
}
\registerenc: 8z  \registerenc: 8t

\ofsdeclarefamily [DynaGroteskRC] {% --------- Dynamo Grotesk RC
   \loadtextfam sdgr\fotenc c;%
                sdgb\fotenc c;%
                sdgri\fotenc c;%
                sdgbi\fotenc c;6s;%
   \def\TeX{T\kern-.09em\lower.5ex\hbox{E}\kern-.1emX}%
   \modifyenc 8z:storm;%
   \modifyenc 8t:storm;%
}
\registerenc: 8z  \registerenc: 8t

\ofsdeclarefamily [DynaGroteskLC] {% --------- Dynamo Grotesk LC
   \loadtextfam sdgl\fotenc c;%
                sdgd\fotenc c;%
                sdgli\fotenc c;%
                sdgdi\fotenc c;6s;%
   \def\TeX{T\kern-.09em\lower.5ex\hbox{E}\kern-.1emX}%
   \modifyenc 8z:storm;%
   \modifyenc 8t:storm;%
}
\registerenc: 8z  \registerenc: 8t

\ofsdeclarefamily [DynaGroteskDXC] {% -------- Dynamo Grotesk DXC
   \loadtextfam sdgd\fotenc q;%
                sdgc\fotenc q;%
                sdgdi\fotenc q;%
                sdgci\fotenc q;6s;%
   \def\TeX{T\kern-.05em\lower.5ex\hbox{E}\kern-.05emX}%
   \modifyenc 8z:storm;%
   \modifyenc 8t:storm;%
}
\registerenc: 8z  \registerenc: 8t

\ofsdeclarefamily [DynaGroteskRXC] {% -------- Dynamo Grotesk RXC
   \loadtextfam sdgr\fotenc q;%
                sdgb\fotenc q;%
                sdgri\fotenc q;%
                sdgbi\fotenc q;6s;%
   \def\TeX{T\kern-.05em\lower.5ex\hbox{E}\kern-.05emX}%
   \modifyenc 8z:storm;%
   \modifyenc 8t:storm;%
}
\registerenc: 8z  \registerenc: 8t

\ofsdeclarefamily [DynaGroteskLXC] {% -------- Dynamo Grotesk LXC
   \loadtextfam sdgl\fotenc q;%
                sdgd\fotenc q;%
                sdgli\fotenc q;%
                sdgdi\fotenc q;6s;%
   \def\TeX{T\kern-.05em\lower.5ex\hbox{E}\kern-.05emX}%
   \modifyenc 8z:storm;%
   \modifyenc 8t:storm;%
}
\registerenc: 8z  \registerenc: 8t

%%%% The macros for acces to whole superfamily Dynamo Grotesk.
%%%% See usage at the end of this file.

\def\setdynamo [#1/#2/#3]{%
  \ifx\expandaction\noexpand
     \noexpand\setdynamo [#1/#2/#3]%
  \else
     \csname fragilecommand!\endcsname
     \edef\tmpa{#1}\ifx\tmpa\empty \else 
        \expandafter \ifx \csname dynaV:\tmpa\endcsname \relax
           \message{setdynamo: unknown parameter: "\tmpa"}%
        \else \edef\currdynavariant {#1}\fi\fi
     \edef\tmpa{#2}\ifx\tmpa\empty \else 
        \expandafter \ifx \csname dynaE:\tmpa\endcsname \relax
           \message{setdynamo: unknown parameter: "\tmpa"}%
        \else \edef\currdynaweight  {#2}\fi\fi
     \edef\tmpa{#3}\ifx\tmpa\empty \else 
        \expandafter \ifx \csname dynaW:\tmpa\endcsname \relax
           \message{setdynamo: unknown parameter: "\tmpa"}%
        \else\edef\currdynawidth   {#3}\fi\fi
     \expandafter \ifx \csname\fulldynaname\endcsname \relax
     \global \expandafter \font \csname\fulldynaname\endcsname
         sdg\csname dynaE:\currdynaweight\endcsname
            \csname dynaV:\currdynavariant\endcsname
            \fotenc
            \csname dynaW:\currdynawidth\endcsname\space\fosize
         \fontmessage{setdynamo: \font \csname\fulldynaname\endcsname =
            sdg\csname dynaE:\currdynaweight\endcsname
               \csname dynaV:\currdynavariant\endcsname
               \fotenc
               \csname dynaW:\currdynawidth\endcsname\space\fosize}%
     \fi
     \csname\fulldynaname\endcsname
     \ignorespaces
  \fi
}
\def\fulldynaname{dyna:\currdynavariant/\currdynaweight
      /\currdynawidth/\fosize}
\def\setdynaconversion#1#2#3{\expandafter\gdef\csname dyna#1:#2\endcsname{#3}}
\setdynaconversion {V}{up}{}
\setdynaconversion {V}{rm}{}
\setdynaconversion {V}{it}{i}
\setdynaconversion {E}{L}{l}
\setdynaconversion {E}{R}{r}
\setdynaconversion {E}{D}{d}
\setdynaconversion {E}{B}{b}
\setdynaconversion {E}{K}{c}
\setdynaconversion {W}{XE}{v}
\setdynaconversion {W}{E}{e}
\setdynaconversion {W}{R}{}
\setdynaconversion {W}{M}{n}
\setdynaconversion {W}{C}{c}
\setdynaconversion {W}{XC}{q}
\def\currdynavariant{up} \def\currdynaweight{R} \def\currdynawidth{R}

\def\changedynamo [#1]{%
  \ifx\expandaction\noexpand
     \noexpand\changedynamo [#1]%
  \else
     \csname fragilecommand!\endcsname
     \let\next=\changedynamostep
     \next #1^^X%
  \fi
} 
\def\changedynamostep #1{%
  \if ^^X#1\let\next=\ignorespaces
  \else\if <#1% --- more extend
     \def\tmpb ##1##2##3|{\def\tmpa ####1##1##2####2####3:{####2}%
        \edef\tmpa{\tmpa XCC.M.R.E.{XE}XE{XE}:}}%
     \expandafter \tmpb \currdynawidth .|%
     \edef\currdynawidth{\tmpa}%
  \else\if >#1% --- more condense
     \def\tmpb ##1##2##3|{\def\tmpa ####1##1##2####2####3:{####2}%
        \edef\tmpa{\tmpa XEE.R.M.C.{XC}XC{XC}:}}%
     \expandafter \tmpb \currdynawidth .|%
     \edef\currdynawidth{\tmpa}%
  \else\if -#1% --- more light
     \def\tmpb ##1{\def\tmpa ####1##1####2####3:{####2}%
        \edef\tmpa{\tmpa KBDRLL:}}%
     \expandafter \tmpb \currdynaweight %
     \edef\currdynaweight{\tmpa}%
  \else\if +#1% --- more heavy
     \def\tmpb ##1{\def\tmpa ####1##1####2####3:{####2}%
        \edef\tmpa{\tmpa LRDBKK:}}%
     \expandafter \tmpb \currdynaweight %
     \edef\currdynaweight{\tmpa}%
  \else\if *#1% --- switch up-it
     \def\tmpa{it}%
     \ifx\currdynavariant\tmpa \def\currdynavariant{up}%
     \else \def\currdynavariant{it}\fi
  \fi\fi\fi\fi\fi\fi
  \next
}
\endinput

%%%%%%%%% Usage of global Dynamo-macros %%%%%%%%%%%%%

\setdymano [variant/weight/width] sets one font. The possibilities:
    variant: up (or rm), it
    weight:  L (light), R (regular), D (demi), B (bold), K (Black)
    width:  XE (extra extended), E (extended), R (regular), 
            M (medium), C (condensed), XC (extra condensed).
    if some parameter is empty, the current one is used.
    Current defaults are:  [up/R/R]

Examples: 
---------
\setdynamo [up/D/E]  ... sets upright variant in DemiExtended
\setdynamo [it/K/XC] ... sets the Black ExtraExtended Italic
\setdynamo [/R/R]    ... sets the regular weight and width, the
                         current variant (rm or it) is unchanged.

\setdynamo [it//]    ... sets the italic in current weight and width.
\setfonts[/17pt]\setdynamo[//] ... sets the current dynamo variant in
                         a new size.

The \changedynamo macro is able to change the variant or weight or
width relatively to the current values of these parameters.
You can move to arbitrary direction in three dimensional table:

black   :  K/XE      K/E      K/R      K/M       K/C       K/XC
bold    :  B/XE      B/E      B/R      B/M       B/C       B/XC
demi    :  D/XE      D/E      D/R      D/M       D/C       D/XC
regular :  R/XE      R/E      R/R      R/M       R/C       R/XC
light   :  L/XE      L/E      L/R      L/M       L/C       L/XC
        --------------------------------------------------------------
          extra    extended  regular  semi-     condensed   extra
         extended                     condensed             condensed

The third dimension of this table represents two variants: up-it.
The parameter [in brackets] includes zero or more characters 
<, >, +, -, * with the following meaning:

   < :  move left in the table
   > :  move right in the table
   + :  move up in the table   
   - :  move down in the table
   * :  change up->it or it->up

You need to use \setdynamo [//] in order to changes of the parameters
will be realised in really font selection.

Examples:
---------
\setdynamo [up/D/C] ... now, we are printing in DemiCondensed
\changedynamo[>]\setdynamo[//] ... now, in DemiExtraCondensed,
\changedynamo[>]\setdynamo[//] ... now, nothing hapens,
\changedynamo[+]\setdynamo[//] ... now. we are printing in BoldExtraCondensed
\changedynamo[--]\setdynamo[//] ... now in RegularExtraCondensed
\changedynamo[*<<<<+++]\setdynamo[//] ... BlackExtended Italic.

\def\bolddynamo{\changedynamo[++]\setdynamo[//]}

