From 1a125fb1a26e163434d9cf498c89854e155b48e0 Mon Sep 17 00:00:00 2001 From: fred Date: Wed, 27 Mar 2002 02:04:16 +0000 Subject: [PATCH] lilypond-1.5.23 --- Documentation/header.html.in | 2 +- lily/lookup.cc | 15 +++++--- lily/my-lily-parser.cc | 5 --- lily/parser.yy | 6 ++-- lilypond-mode.el | 48 +++++++++++++++++++++++++ scripts/lilypond-book.py | 52 +++++++++++++++++---------- stepmake/stepmake/metafont-rules.make | 6 ++++ 7 files changed, 101 insertions(+), 33 deletions(-) diff --git a/Documentation/header.html.in b/Documentation/header.html.in index bd4b116593..f5a7104cac 100644 --- a/Documentation/header.html.in +++ b/Documentation/header.html.in @@ -50,7 +50,7 @@ which substitutes some @AT_VARIABLES@ as well. GNU/Linux binaries
- GNU/Windows binaries
+ Windows binaries
Source code
diff --git a/lily/lookup.cc b/lily/lookup.cc index 036ba88959..40af656ee3 100644 --- a/lily/lookup.cc +++ b/lily/lookup.cc @@ -125,11 +125,14 @@ Lookup::slur (Bezier curve, Real curvethick, Real linethick) { Real alpha = (curve.control_[3] - curve.control_[0]).arg (); Bezier back = curve; - + Offset perp = curvethick * complex_exp (Offset (0, alpha + M_PI/2)) * 0.5; back.reverse (); - back.control_[1] += curvethick * complex_exp (Offset (0, alpha + M_PI/2)); - back.control_[2] += curvethick * complex_exp (Offset (0, alpha + M_PI/2)); + back.control_[1] += perp; + back.control_[2] += perp; + curve.control_[1] -= perp; + curve.control_[2] -= perp; + SCM scontrols[8]; for (int i=4; i--;) @@ -152,8 +155,12 @@ Lookup::slur (Bezier curve, Real curvethick, Real linethick) ly_quote_scm (list), gh_double2scm (linethick), SCM_UNDEFINED)); + Box b(curve.extent (X_AXIS), + curve.extent (Y_AXIS)); + + b[X_AXIS].unite (back.extent (X_AXIS)); + b[Y_AXIS].unite (back.extent (Y_AXIS)); - Box b (curve.extent (X_AXIS), curve.extent (Y_AXIS)); return Molecule (b, at); } diff --git a/lily/my-lily-parser.cc b/lily/my-lily-parser.cc index c850a72104..937c0f338a 100644 --- a/lily/my-lily-parser.cc +++ b/lily/my-lily-parser.cc @@ -83,11 +83,6 @@ My_lily_parser::parser_error (String s) exit_status_global = 1; } -void -My_lily_parser::set_last_duration (Duration const *d) -{ - default_duration_ = *d; -} Input diff --git a/lily/parser.yy b/lily/parser.yy index 2194356763..022451ca8d 100644 --- a/lily/parser.yy +++ b/lily/parser.yy @@ -1615,9 +1615,11 @@ optional_notemode_duration: } | multiplied_duration { $$ = $1; + THIS->default_duration_ = *unsmob_duration ($$); } | explicit_duration { $$ = $1; + THIS->default_duration_ = *unsmob_duration ($$); } ; @@ -1630,15 +1632,11 @@ steno_duration: l = intlog2 ($1); $$ = Duration (l, $2).smobbed_copy (); - - THIS->set_last_duration (unsmob_duration ($$)); } | DURATION_IDENTIFIER dots { Duration *d =unsmob_duration ($1); Duration k (d->duration_log (),d->dot_count () + $2); $$ = k.smobbed_copy (); - - THIS->set_last_duration (unsmob_duration ($$)); } ; diff --git a/lilypond-mode.el b/lilypond-mode.el index 60e1a9c2cf..647f03862a 100644 --- a/lilypond-mode.el +++ b/lilypond-mode.el @@ -149,6 +149,18 @@ in LilyPond-include-path." :group 'LilyPond :type 'string) +(defcustom LilyPond-gv-command "gv -watch" + "Command used to display PS files." + + :group 'LilyPond + :type 'string) + +(defcustom LilyPond-midi-command "timidity" + "Command used to play MIDI files." + + :group 'LilyPond + :type 'string) + ;; This is the major configuration variable. (defcustom LilyPond-command-alist `( @@ -311,6 +323,42 @@ Must be the car of an entry in `LilyPond-command-alist'." (LilyPond-command (LilyPond-command-menu "Midi") 'LilyPond-master-file) ) +(defun LilyPond-command-formatdvi () + "Format the dvi output of the current document." + (interactive) + (LilyPond-command (LilyPond-command-menu "2Dvi") 'LilyPond-master-file) +) + +(defun LilyPond-command-formatps () + "Format the ps output of the current document." + (interactive) + (LilyPond-command (LilyPond-command-menu "2PS") 'LilyPond-master-file) +) + +(defun LilyPond-command-smartview () + "View the dvi output of current document." + (interactive) + (LilyPond-command (LilyPond-command-menu "SmartView") 'LilyPond-master-file) +) + +(defun LilyPond-command-view () + "View the dvi output of current document." + (interactive) + (LilyPond-command (LilyPond-command-menu "View") 'LilyPond-master-file) +) + +(defun LilyPond-command-viewps () + "View the ps output of current document." + (interactive) + (LilyPond-command (LilyPond-command-menu "ViewPS") 'LilyPond-master-file) +) + +(defun LilyPond-command-midi () + "View the ps output of current document." + (interactive) + (LilyPond-command (LilyPond-command-menu "Midi") 'LilyPond-master-file) +) + ;; FIXME, this is broken (defun LilyPond-region-file (begin end) (let ( diff --git a/scripts/lilypond-book.py b/scripts/lilypond-book.py index 1686b60c6c..efd48214a3 100644 --- a/scripts/lilypond-book.py +++ b/scripts/lilypond-book.py @@ -12,6 +12,10 @@ # geometry.sty and article.cls. Give me a hint, and I'll # fix it.) +# +# TODO: magnification support should also work for texinfo -> html: eg. add as option to dvips. +# + # This is was the idea for handling of comments: # Multiline comments, @ignore .. @end ignore is scanned for # in read_doc_file, and the chunks are marked as 'ignore', so @@ -31,6 +35,8 @@ # The the rest of the rexeces are searched for. They don't have to test # if they are on a commented out line. + + import os import stat import string @@ -927,16 +933,6 @@ def process_lilypond_blocks(outname, chunks):#ugh rename return newchunks -def find_eps_dims (match): - "Fill in dimensions of EPS files." - - fn =match.group (1) - dims = bounding_box_dimensions (fn) - if g_outdir: - fn = os.path.join(g_outdir, fn) - - return '%ipt' % dims[0] - def system (cmd): sys.stderr.write ("invoking `%s'\n" % cmd) @@ -955,19 +951,20 @@ def get_bbox (filename): if m: gr = map (string.atoi, m.groups ()) break - + return gr def make_pixmap (name): bbox = get_bbox (name + '.eps') - + margin = 3 fo = open (name + '.trans.eps' , 'w') - fo.write ('%d %d translate\n' % (-bbox[0], -bbox[1])) + fo.write ('%d %d translate\n' % (-bbox[0]+margin, -bbox[1]+margin)) fo.close () res = 90 - x = (bbox[2] - bbox[0]) * res / 72. - y = (bbox[3] - bbox[1]) * res / 72. + + x = (2* margin + bbox[2] - bbox[0]) * res / 72. + y = (2* margin + bbox[3] - bbox[1]) * res / 72. cmd = r"""gs -g%dx%d -sDEVICE=pgm -dTextAlphaBits=4 -dGraphicsAlphaBits=4 -q -sOutputFile=- -r%d -dNOPAUSE %s %s -c quit | pnmtopng > %s""" @@ -1187,14 +1184,31 @@ def check_texidoc (chunks): n.append (c) return n + +## what's this? Docme --hwn +## def fix_epswidth (chunks): newchunks = [] for c in chunks: - if c[0] == 'lilypond' and 'eps' in c[2]: - body = re.sub (r"""\\lilypondepswidth{(.*?)}""", find_eps_dims, c[1]) - newchunks.append(('lilypond', body, c[2], c[3], c[4])) - else: + if c[0] <> 'lilypond' or 'eps' not in c[2]: newchunks.append (c) + continue + + mag = 1.0 + for o in c[2]: + m = re.match ('magnification=([0-9.]+)', o) + if m: + mag = string.atof (m.group (1)) + + def replace_eps_dim (match, lmag = mag): + filename = match.group (1) + dims = bounding_box_dimensions (filename) + + return '%fpt' % (dims[0] *lmag) + + body = re.sub (r"""\\lilypondepswidth{(.*?)}""", replace_eps_dim, c[1]) + newchunks.append(('lilypond', body, c[2], c[3], c[4])) + return newchunks diff --git a/stepmake/stepmake/metafont-rules.make b/stepmake/stepmake/metafont-rules.make index b8d78cf76f..eb2e55b1ab 100644 --- a/stepmake/stepmake/metafont-rules.make +++ b/stepmake/stepmake/metafont-rules.make @@ -33,6 +33,12 @@ $(outdir)/%.pfb: + + +$(outdir)/%.pfb: + pktrace $(basename $(@F)) + mv $(basename $(@F)).pfb $(outdir) + #%.afm: # $(SHELL) $(depth)/buildscripts/tfmtoafm.sh $(shell basename $@ .afm) # mv $@ $@.in -- 2.39.5