% fetdefs.tex
% encapsulating tex backend for auto-generated font-en-tja definitions

\def\fetsixteendefs{
        \font\fontentja=font-en-tja16
        \font\vetfont=vette-beams16
	\font\fetanummer=feta-nummer8
}
\def\fettwentydefs{
        \font\fontentja=font-en-tja20
        \font\vetfont=vette-beams20
	\font\fetanummer=feta-nummer10
}

% \def\fetdef#1#2{\def#1{\fetchar{#2}}}
% ugh, linewidth, ugh, tablexx.ly balldims not used!
\def\fetdef#1#2{\def#1{\lower.3884\staffrulethickness\hbox{\fetchar{#2}}}}
\def\fetchar#1{\fontentja\char#1}

%\input font-en-tja16
\input font-en-tja20

\def\beamslope#1#2{{\count0=#2\advance\count0 by#1
        \advance\count0by128
        {\vetfont\char\count0}}}

% stacked numbers; overrules def in lilyponddefs
% oeps: \meter 12/8;
\def\generalmeter#1#2{%
	\vbox to 0pt{\vss%
	\hbox to0.42\balkheight{\hss\fetanummer\char#1\hss}%
	\nointerlineskip%
        \hbox to0.42\balkheight{\hss\fetanummer\char#2\hss}%
	\vss}}

\newcount\embedcount\embedcount=0
\newwrite\checkexists
\newwrite\embedfile

\def\inputifexists#1{%
	\openin\checkexists #1
      	\ifeof\checkexists
		 \closein\checkexists
	   	 \relax
	\else
		\closein\checkexists
		\input #1
    	\fi
}
\def\embedcountid{feta-embed}
\inputifexists{\embedcountid.aux}
% let's not overwrite -- and be sure to create new
\def\storeembedcount{%
	\immediate\openout\embedfile=\embedcountid.aux
	\immediate\write\embedfile{\embedcount=\the\embedcount}
	\immediate\closeout\embedfile
}
\def\EndLilyPondOutput{
	\storeembedcount
	\csname bye\endcsname
}
\def\embeddedps#1{
	\edef\embedid{feta-sleur-\number\embedcount}
	\immediate\openout\embedfile=\embedid.eps
	\advance\embedcount by 1
	\immediate\write\embedfile{#1}
	\immediate\closeout\embedfile
	\special{psfile=\embedid.eps}
}
\def\embeddedmf#1{
	\edef\embedid{feta-sleur-\number\embedcount}
	\immediate\openout\embedfile=\embedid.mf
	\global\advance\embedcount by 1
	\immediate\write\embedfile{#1}
	\immediate\closeout\embedfile
        \font\expandafter\embedid\expandafter=\embedid
	\hbox{\embedid\char0}
}
\def\embeddedps#1{}
%\def\embeddedmf#1{}
