lilypond-1.1.5
[lilypond.git] / tex / lily-mf-defs.tex
blobb30ba9fd5dd647512ac415b49ee696951169396d
1 \newcount\embedcount\embedcount=0
2 \newwrite\checkexists
3 \newwrite\embedfile
4 \def\inputifexists#1{%
5 \openin\checkexists #1
6 \ifeof\checkexists
7 \closein\checkexists
8 \else
9 \closein\checkexists
10 \input #1
11 \fi
14 \def\embedcountid{feta-embed}
15 \inputifexists{\embedcountid.aux}
17 % let's not overwrite -- and be sure to create new
18 \def\embedclose{%
19 \immediate\openout\embedfile=\embedcountid.aux
20 \immediate\write\embedfile{\embedcount=\the\embedcount}
21 \immediate\closeout\embedfile
25 % let's keep embedcount to see how many embedded mf's clutter your system
26 \def\embeddedmf#1#2{%
27 \edef\embedid{#1}%
28 \immediate\openout\embedfile=\embedid.mf%
29 \global\advance\embedcount by 1%
30 \immediate\write\embedfile{\%Automatically generated by TeX (fetdefs.tex
31 )}%
32 \immediate\write\embedfile{\%Do not edit}%
33 \immediate\write\embedfile{#2}%
34 \immediate\closeout\embedfile%
35 \font\expandafter\embedid\expandafter=\embedid%
36 \embedid\char0%