% fetdefs.tex
% encapsulating tex backend for auto-generated feta definitions

\def\placebox#1#2#3{%
        \botalign{\hbox{\raise #1\leftalign{\kern #2{}#3}}}}%


\def\fetsixteendefs{%
  \font\fetasixteen = feta16
  \font\fetanummersixteen = feta-nummer8
  \font\dynfontsixteen = feta-din10 scaled \magstep 1
  \font\bracefontsixteen = feta-braces16
  \font\fingerfontsixteen = feta-nummer4
  \font\markfontsixteen = feta-nummer10
\def\currentsize{sixteen}
}

\def\fettwentydefs{%
  \font\fetatwenty = feta20
  \font\fetanummertwenty = feta-nummer10
  \font\dynfonttwenty = feta-din10 scaled \magstep 2
  \font\bracefonttwenty = feta-braces20
  \font\fingerfonttwenty = feta-nummer5
  \font\markfonttwenty = feta-nummer12
\def\currentsize{twenty}
}

\def\fettwentysixdefs{%
  \font\fetatwentysix = feta26
  \font\fetanummertwentysix = feta-nummer12
  \font\dynfonttwentysix = feta-din10 scaled \magstep 3
  \font\bracefonttwentysix = feta-braces16
  \font\fingerfonttwenty = feta-nummer7
  \font\markfonttwentysix = feta-nummer14
\def\currentsize{twentysix}
}

\def\fetthirteendefs{%
  \font\fetathirteen = feta13
  \font\fetanummerthirteen = feta-nummer5
  \font\dynfontthirteen = feta-din10 scaled \magstep 0
  \font\bracefontthirteen = feta-braces16
  \font\fingerfontthirteen = feta-nummer3
  \font\markfonttwentysix = feta-nummer8
\def\currentsize{thirteen}
}

\def\fetelevendefs{%
  \font\fetaeleven = feta11
  \font\fetanummereleven = feta-nummer5
  \font\dynfonteleven = feta-din10        % scaled \magstep-1
  \font\bracefonteleven = feta-braces16
  \font\fingerfonteleven = feta-nummer3
  \font\markfonttwentysix = feta-nummer7
  \def\currentsize{eleven}
}

\def\sixteenfonts{\fetsixteendefs\cmrsixteen}
\def\twentyfonts{\fettwentydefs\cmrtwenty}
\def\twentysixfonts{\fettwentysixdefs\cmrtwenty}
\def\elevenfonts{\fetelevendefs\cmreleven}
\def\thirteenfonts{\fetthirteendefs\cmrthirteen}

\def\bracefont{\csname bracefont\currentsize\endcsname}
\def\fetanummer{\csname fetanummer\currentsize\endcsname}
\def\dynfont{\csname dynfont\currentsize\endcsname}
\def\fingerfont{\csname fingerfont\currentsize\endcsname}
\def\markfont{\csname markfont\currentsize\endcsname}

%\sixteenfonts
%\twentysixfonts
%\twentyfonts
%\elevenfonts
%\thirteenfonts

\def\switchfont#1{\def\currentsize{#1}\csname feta\currentsize\endcsname}

\def\fetdef#1#2{%
  \def#1{\hbox{\fetchar{#2}}}}
\def\fetchar#1{\char#1}

%\input feta16
%\input feta20

% stacked numbers; overrules def in lilyponddefs
% widest num should be .40 balkheight
% oeps: \meter 12/8;
%
% \allabreve, \threetwometer etc. have zero as the second parameter.

\def\generalmeter#1#2{%
  \ifnum #2 = 0\relax
    \ifcase #1
    \or\or
      % 2
      \allabreve
    \or
      % 3
      \threetwometer    % tempus perfectum cum prolatione imperfecta
    \or
      % 4
      \fourfourmeter    % tempus imperfectum cum prolatione imperfecta
    \or\or
      % 6
      \sixfourmeter     % tempus imperfectum cum prolatione perfecta
    \or\or\or
      % 9
      \ninefourmeter    % tempus perfectum cum prolatione perfecta
    \fi
  \else
    \vbox to 0pt{%
      \vss
      \hbox to 0.45\staffheight{\hss \fetanummer #1\hss}%
      \nointerlineskip
      \hbox to 0.45\staffheight{\hss \fetanummer #2\hss}%
      \vss}%
  \fi}

\def\pianobrace#1{{\bracefont\char #1}}
\def\staffbracket#1{{\centeralign{\bracketfont\char #1}}}

\def\embeddedtex#1{}
\def\embeddedps#1{}
\def\embeddedmf#1#2{}
\def\embedclose{}

\input lily-ps-defs

% uncomment to use runtime MF
%
% \input lily-mf-defs

\def\EndLilyPondOutput{%
  \embedclose
  \csname bye\endcsname
}

\endinput
