+pl 26.jcn1
+ - bf: numerals
+ - sleur.ly
+ - embedded slur testing (mf is default)
+ - bf + patch: make-patch release.py / VERSION
+
pl 26
- bf: \transpose
- feta: numerals 0 - 9, rewrote flags.
TOPLEVEL_MAJOR_VERSION = 0
TOPLEVEL_MINOR_VERSION = 1
TOPLEVEL_PATCH_LEVEL = 26
-TOPLEVEL_MY_PATCH_LEVEL =
-
# use the above to send patches, always empty for released version:
+# must not include leading . anymore! (why has convention changed?)
+TOPLEVEL_MY_PATCH_LEVEL = jcn1
+
mi = atoi(val)
elif nm == 'TOPLEVEL_PATCH_LEVEL':
pa = atoi(val)
- elif nm == 'TOPLEVEL_MY_PATCH_LEVEL':
- mp = val
+ # why has convention changed?
+ elif nm == 'TOPLEVEL_MY_PATCH_LEVEL' and nm != '':
+ mp = '.' + val
return (mj,mi,pa,mp)
def next_version(tup):
--- /dev/null
+#!@PYTHON@
+from lilypython import *
+import getopt
+import pipes
+
+
+mp_version = '2'
+
+class Options:
+ def __init__(self):
+ self.to_version = lilydirs.version_tuple()
+ self.from_version = prev_version(self.to_version)
+
+options = Options()
+
+
+def help():
+ sys.stdout.write(
+ 'Generate a patch to go to this version.\n'
+ ' --from=FROM, -f FROM old is FROM\n'
+ ' --to=TO, -t TO to version TO\n'
+
+ )
+
+
+
+def untar(fn):
+ # os.system('pwd');
+ sys.stderr.write('untarring ' + fn)
+# can't seem to fix errors:
+# gzip: stdout: Broken pipe
+# tar: Child returned status 1
+# os.system ('tar xzf ' + fn)
+# sys.stderr.write('\n')
+# ugh, even this does not work, but one error message less :-)
+ os.system ('gzip -dc ' + fn + '| tar xf - ')
+# so print soothing message:
+ sys.stderr.write('make-patch:ugh: Please ignore error: gzip: stdout: Broken pipe\n');
+ sys.stderr.flush()
+
+
+header = 'Generated by make-patch, old = %s, new = %s\n\
+\n\
+usage \n\
+\n\
+ cd lilypond-source-dir; patch -E -p0 < %s\n\
+\n\
+Patches do not contain automatically generated files, \n\
+i.e. you should rerun configure\n\n'
+
+import fnmatch
+import os
+
+_debug = 0
+
+_prune = ['(*)']
+
+
+def my_find(patterns, dir = os.curdir):
+ list = []
+ names = os.listdir(dir)
+ names.sort()
+ for name in names:
+ if name in (os.curdir, os.pardir):
+ continue
+ fullname = os.path.join(dir, name)
+ for pat in patterns:
+ if fnmatch.fnmatch(name, pat):
+ list.append(fullname)
+ if os.path.isdir(fullname) and not os.path.islink(fullname):
+ for p in _prune:
+ if fnmatch.fnmatch(name, p):
+ if _debug: print "skip", `fullname`
+ break
+ else:
+ if _debug: print "descend into", `fullname`
+ found = my_find(patterns, fullname)
+ if found:
+ list = list + found
+ return list
+
+def multiple_find(pats, dirnames):
+ from find import find
+ l = []
+ for d in dirnames:
+ l = l + my_find(pats, d)
+ return l
+
+pats = ['*.lsm', 'configure', '*.text', 'lilypond.spec']
+def remove_automatic(dirnames):
+ files = []
+ files = files + multiple_find(pats, dirnames)
+
+ for f in files:
+ os.remove(f)
+
+def makepatch(fv, tv, patfile_nm):
+ import tempfile
+ prev_cwd = os.getcwd();
+ os.chdir ('/tmp')
+ untar(released_tarball(fv))
+ untar(released_tarball(tv))
+ remove_automatic([dirname(fv), dirname(tv)])
+
+ os.chdir(dirname(tv))
+
+ if not patfile_nm:
+ patfile_nm = '../patch-%s' % version_tuple_to_str(tv)
+
+ f = open(patfile_nm, 'w')
+ f.write(header %\
+ (version_tuple_to_str(fv), version_tuple_to_str(tv), \
+ os.path.basename(patfile_nm)))
+ f.close()
+
+ sys.stderr.write('diffing to %s... ' % patfile_nm)
+ os.system('diff -urN ../%s . >> %s' % (dirname(fv), patfile_nm))
+ #os.system('gzip -9f %s' % patfile_nm)
+ os.chdir('/tmp')
+
+ sys.stderr.write('cleaning ... ')
+ os.system('rm -fr %s %s' % (dirname(tv), dirname(fv)))
+ sys.stderr.write('\n')
+ os.chdir(prev_cwd)
+
+def main():
+ sys.stderr.write('This is make-patch version %s\n' % mp_version)
+ (cl_options, files) = getopt.getopt(sys.argv[1:],
+ 'hf:o:t:', ['output=', 'help', 'from=', 'to='])
+ outfn = ''
+ for opt in cl_options:
+ o = opt[0]
+ a = opt[1]
+ if o == '--from' or o == '-f':
+ options.from_version = version_str_to_tuple(a)
+ elif o == '--to' or o == '-t':
+ options.to_version = version_str_to_tuple(a)
+ elif o== '--help' or o == '-h':
+ help()
+ return 0;
+ elif o == '--output' or o == '-o':
+ outfn = os.path.join(os.getcwd(), a)
+ else:
+ raise getopt.error
+
+ if not outfn:
+ pn = 'patch-%s' % version_tuple_to_str(options.to_version)
+ outfn = os.path.join(os.getcwd(), pn)
+
+ makepatch(options.from_version, options.to_version, outfn)
+
+if __name__ == '__main__':
+ main()
-#!@PYTHON@
-from lilypython import *
-import getopt
-import pipes
-
-
-mp_version = '2'
-
-class Options:
- def __init__(self):
- self.to_version = lilydirs.version_tuple()
- self.from_version = prev_version(self.to_version)
-
-options = Options()
-
-
-def help():
- sys.stdout.write(
- 'Generate a patch to go to this version.\n'
- ' --from=FROM, -f FROM old is FROM\n'
- ' --to=TO, -t TO to version TO\n'
-
- )
-
-
-
-def untar(fn):
- sys.stderr.write('untarring ' + fn)
- os.system ('tar xzf ' + fn)
- sys.stderr.write('\n')
- sys.stderr.flush()
-
-
-header = 'Generated by make-patch, old = %s, new = %s\n\
-\n\
-usage \n\
-\n\
- cd lilypond-source-dir; patch -E -p0 < %s\n\
-\n\
-Patches do not contain automatically generated files, \n\
-i.e. you should rerun configure\n\n'
-
-import fnmatch
-import os
-
-_debug = 0
-
-_prune = ['(*)']
-
-
-def my_find(patterns, dir = os.curdir):
- list = []
- names = os.listdir(dir)
- names.sort()
- for name in names:
- if name in (os.curdir, os.pardir):
- continue
- fullname = os.path.join(dir, name)
- for pat in patterns:
- if fnmatch.fnmatch(name, pat):
- list.append(fullname)
- if os.path.isdir(fullname) and not os.path.islink(fullname):
- for p in _prune:
- if fnmatch.fnmatch(name, p):
- if _debug: print "skip", `fullname`
- break
- else:
- if _debug: print "descend into", `fullname`
- found = my_find(patterns, fullname)
- if found:
- list = list + found
- return list
-
-def multiple_find(pats, dirnames):
- from find import find
- l = []
- for d in dirnames:
- l = l + my_find(pats, d)
- return l
-
-pats = ['*.lsm', 'configure', '*.text', 'lilypond.spec']
-def remove_automatic(dirnames):
- files = []
- files = files + multiple_find(pats, dirnames)
-
- for f in files:
- os.remove(f)
-
-def makepatch(fv, tv, patfile_nm):
- import tempfile
- prev_cwd = os.getcwd();
- os.chdir ('/tmp')
- untar(released_tarball(fv))
- untar(released_tarball(tv))
- remove_automatic([dirname(fv), dirname(tv)])
-
- os.chdir(dirname(tv))
-
- if not patfile_nm:
- patfile_nm = '../patch-%s' % version_tuple_to_str(tv)
-
- f = open(patfile_nm, 'w')
- f.write(header %\
- (version_tuple_to_str(fv), version_tuple_to_str(tv), \
- os.path.basename(patfile_nm)))
- f.close()
-
- sys.stderr.write('diffing to %s... ' % patfile_nm)
- os.system('diff -urN ../%s . >> %s' % (dirname(fv), patfile_nm))
- #os.system('gzip -9f %s' % patfile_nm)
- os.chdir('/tmp')
-
- sys.stderr.write('cleaning ... ')
- os.system('rm -fr %s %s' % (dirname(tv), dirname(fv)))
- sys.stderr.write('\n')
- os.chdir(prev_cwd)
-
-def main():
- sys.stderr.write('This is make-patch version %s\n' % mp_version)
- (cl_options, files) = getopt.getopt(sys.argv[1:],
- 'hf:o:t:', ['output=', 'help', 'from=', 'to='])
- outfn = ''
- for opt in cl_options:
- o = opt[0]
- a = opt[1]
- if o == '--from' or o == '-f':
- options.from_version = version_str_to_tuple(a)
- elif o == '--to' or o == '-t':
- options.to_version = version_str_to_tuple(a)
- elif o== '--help' or o == '-h':
- help()
- elif o == '--output' or o == '-o':
- outfn = os.path.join(os.getcwd(), a)
- else:
- raise getopt.error
-
- if not outfn:
- pn = 'patch-%s' % version_tuple_to_str(options.to_version)
- outfn = os.path.join(os.getcwd(), pn)
-
- makepatch(options.from_version, options.to_version, outfn)
-
-if __name__ == '__main__':
- main()
#!@PYTHON@
from lilypython import *
-import makepatch
-
os.chdir(lilydirs.topdir)
os.system('make dist')
os.rename('out/' + tarball(cur_ver), released_tarball(cur_ver))
os.chdir('../test')
+os.system('pwd')
os.system('rm ../test/*gz')
os.link(released_tarball(cur_ver), tarball(cur_ver))
-makepatch.main()
+# not a module, but a script:
+# makepatch.main()
+os.system('python ' + lilydirs.topdir + '/bin/make-patch.py');
+
os.system('gzip -9 patch*')
os.system('tar cf updeet *gz')
% generated automatically by mf-to-table.py version 0.4
-% on Mon Oct 27 02:45:17 1997
+% on Tue Oct 28 10:54:24 1997
% Do not edit
% input from out/font-en-tja16.log
% name=\symboltables {
% generated automatically by mf-to-table.py version 0.4
-% on Mon Oct 27 02:45:24 1997
+% on Tue Oct 28 10:54:27 1997
% Do not edit
% input from out/font-en-tja20.log
% name=\symboltables {
--- /dev/null
+\header{
+enteredby = "jcn";
+copyright = "PD";
+TestedFeatures = "This file tests Feta embedded slurs"
+ "(Feta definitively is not an abbreviation of Font-En-TjA)";
+}
+
+%{ remember to:
+rm `find /var/lib/texmf -name "feta-sleur-*"`
+%}
+
+\version "0.1.7";
+
+\score{
+ \melodic{
+ \octave c'
+ ;c'1() g' () c () g () c
+ }
+ \paper{ }
+}
+
#include "dimen.hh"
#include "debug.hh"
#include "paper-def.hh"
+#include "string-convert.hh"
static char
Atom
Lookup::slur (int dy , Real &dx, Direction dir) const
{
-
assert (abs (dir) <= 1);
if (dx < 0)
{
warning (_("Negative slur/tie length: ") + print_dimen (dx));
dx = 4.0 PT;
}
+
+ Atom s;
+ s.dim_[X_AXIS] = Interval (0, dx);
+ s.dim_[Y_AXIS] = Interval (min (0, dy), max (0, dy));
+
+ // duh
+ // let's try the embedded stuff
+ bool embedded_b = true;
+ if (embedded_b)
+ {
+ // huh, factor 8?
+ Real fdy = dy*paper_l_->interline_f ();
+ Real fdx = dx;
+ String ps = "\\embeddedps{\n";
+ // ugh, how bout " /draw_slur { ... } def "
+ ps += "0 0 moveto\n";
+ ps += String_convert::int_str (fdx/2) + " "
+ + String_convert::int_str (fdy/2) + " "
+ + String_convert::int_str (fdx) + " "
+ + String_convert::int_str (fdy) + " curveto\n";
+ ps += "closepath\n";
+ ps += "fill\n";
+ ps += "}\n";
+
+ String mf = "\\embeddedmf{\n";
+ mf += "input feta-sleur;\n";
+ mf += "draw_slur((0,0),";
+ mf += "(" + String_convert::int_str (fdx) + ","
+ + String_convert::int_str (fdy) + "),";
+ mf += String_convert::int_str (dir) + ");\n";
+ mf += "end.\n";
+ ps += "}\n";
+
+ s.tex_ = ps + mf;
+ s.translate_axis (dx/2, X_AXIS);
+ // huh, extra translate?
+
+ s.translate_axis (-1.5*paper_l_->note_width (), X_AXIS);
+ // mmm, does embedded slur always start at y = 0?
+// s.translate_axis (-1.5*paper_l_->note_width (), Y_AXIS);
+
+ return s;
+ }
+
Direction y_sign = (Direction) sign (dy);
bool large = abs (dy) > 8;
WARN<<_("slur to steep: ") << dy << _(" shrinking (ugh)\n");
}
- Atom s;
- s.dim_[X_AXIS] = Interval (0, dx);
- s.dim_[Y_AXIS] = Interval (min (0, dy), max (0, dy));
-
String f = String ("\\slurchar") + String (direction_char (y_sign));
int idx=-1;
f+=String ("{") + String (idx) + "}";
s.tex_ = f;
-
s.translate_axis (dx/2, X_AXIS);
return s;
}
penpos5(norm-hair,180);
z5r=(0,y1);
penpos6(hair,90);
- z6r=(w-norm,h);
+ z6r=(w-norm-hair,h);
penpos7(norm-hair,180);
z7r=(0,h/2);
penpos10(norm-hair,180);
penpos5(norm,0);
z5r=(w-thin,.72h);
penpos6(thin,90);
- z6r=(w/2-thin-hair,h);
+ z6r=(w/2-thin,h);
penlabels(4,5,6);
- fill z1l{dir(beta)}..z4l{dir(15)}..z5r{up}..z6r{left}
+ save t; t=0.90;
+ fill z1l{dir(beta)}..z4l{dir(15)}..z5r{up}..tension t..z6r{left}
..z6l{right}..z5l{down}..z4r{dir(180+15)}
..{dir(180+beta)}z1r..cycle;
draw_flare(z6r,180,90,thin,thick);
save beta; beta=alpha-15;
z1=(w/2,h/2+hair);
penpos2(hair,90+180+beta);
- z2=(w/4,h/2+thin);
- z3=(0,h/4+thin/2);
+ z2=(w/3,h/2+thin);
+ penpos3(thin+hair,0);
+ z3l=(0,h/4+thin/2);
penpos4(hair,90);
z4l=(x1,0);
penpos5(norm,90+90+alpha);
z6=z1+w/4*dir(90+alpha);
penpos7(hair,90);
z7r=(x1,h);
- z8=(w-hair,3/4h+thin/2);
+ penpos8(thin+hair,0);
+ z8r=(w-hair,3/4h+thin/2);
penpos9(hair,90+180+beta);
- z9=(3/4w,h/2);
+ z9=(2/3w,h/2);
penlabels(1,2,3,4,5,6,7,8,9);
save t; t=0.85;
- fill z2r{dir(180+beta)}..tension t..z4r{right}..z5r{dir(90+alpha)}..z6r{dir(90+alpha)}..tension t..z7r{right}..z8{down}..z9r{dir(180+beta)}..z9l{dir(beta)}..tension t..z7l{left}..z6l{dir(alpha-90)}..z5l{dir(alpha-90)}..tension t..z4l{left}..z3{up}..z2l{dir(beta)}..cycle;
+ fill z2r{dir(180+beta)}..z3r{down}..z4r{right}
+ ..z5r{dir(90+alpha)}..z6r{dir(90+alpha)}
+ ..tension t..z7r{right}..z8r{down}..z9r{dir(180+beta)}
+ ..z9l{dir(beta)}..z8l{up}..z7l{left}..z6l{dir(alpha-90)}
+ ..z5l{dir(alpha-90)}..tension t..z4l{left}..z3l{up}
+ ..z2l{dir(beta)}..cycle;
fet_endchar;
fet_beginchar("Numeral 9", "9", "nine")
--- /dev/null
+% feta-sleur.mf
+
+mode_setup;
+thin:=.2pt;
+thick:=5thin;
+bow:=.2;
+
+def sign(expr a) =
+ ((abs(a))/(a))
+ enddef;
+
+def draw_slur(expr a,b,d) =
+ beginchar(0,0,0,0) "Embedded mf";
+ % huh, factor 8?
+ z1=8a;
+ z3=8b;
+ save alpha; alpha=angle(z3-z1);
+ z2=(1/2[x1,x3],1/2[y1,y3])+d*bow*(x3-x1)*dir(alpha+90);
+ save beta; beta=d*sign(y3-y1)*1.5angle(z2-z1)-alpha;
+% message "d: "&decimal d;
+% message "dy: "& decimal sign(y3-y1);
+% message "alpha: "&decimal alpha;
+% message "beta: "&decimal beta;
+ penpos1(thin,alpha+beta+90);
+ penpos2(thick,alpha+90);
+ penpos3(thin,alpha-beta+90);
+ pickup pencircle;
+ fill z1l{dir(alpha+beta)}..z2l{dir(alpha)}..z3l{dir(alpha-beta)}
+ ..z3r{dir(180+alpha-beta)}..z2r{dir(180+alpha)}..z1r{dir(180+alpha+beta)}
+ ..cycle;
+ penlabels(1,2,3);
+ endchar;
+ enddef;
\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{}
% generated automatically by mf-to-table.py version 0.4
-% on Mon Oct 27 02:45:17 1997
+% on Tue Oct 28 10:54:24 1997
% Do not edit
% input from out/font-en-tja16.log
% name
% generated automatically by mf-to-table.py version 0.4
-% on Mon Oct 27 02:45:24 1997
+% on Tue Oct 28 10:54:27 1997
% Do not edit
% input from out/font-en-tja20.log
% name