From c0e993f674ea82187d0dbc57002c5a6010aab38b Mon Sep 17 00:00:00 2001 From: Jan Nieuwenhuizen Date: Fri, 8 Jun 2001 23:23:34 +0200 Subject: [PATCH] patch::: 1.4.2.jcn4 1.4.2.jcn4 --- CHANGES | 4 +- Documentation/topdocs/INSTALL.texi | 3 +- VERSION | 2 +- input/regression/easy-notation.ly | 5 ++- lily/include/note-head.hh | 1 + lily/note-head.cc | 61 +++++++++++++++++++++--------- 6 files changed, 53 insertions(+), 23 deletions(-) diff --git a/CHANGES b/CHANGES index aed1410910..bdb011f50e 100644 --- a/CHANGES +++ b/CHANGES @@ -1,6 +1,8 @@ -1.4.2.jcn3 +1.4.2.jcn4 ========== +* Bugfix: ledger lines on easy-notation note heads. + * Windows: bugfix for tex-wrappers, added tex wrapper for dvips. LilyPond (read: ly2dvi) should now work right out of the box. diff --git a/Documentation/topdocs/INSTALL.texi b/Documentation/topdocs/INSTALL.texi index 623ece58d5..5265baa068 100644 --- a/Documentation/topdocs/INSTALL.texi +++ b/Documentation/topdocs/INSTALL.texi @@ -55,7 +55,8 @@ Binaries are available, but are not updated for every version released. @item @uref{ftp://ftp.cs.uu.nl/pub/GNU/LilyPond/binaries/RedHat/RPMS/, Red Hat i386} @item @uref{ftp://ftp.lilypond.org/pub/LilyPond/binaries/linuxppc/, LinuxPPC} @item @uref{ftp://ftp.debian.org/debian/pool/main/l/lilypond/, Debian GNU/Linux} -@item @uref{http://home.austin.rr.com/jbr/jeff/lilypond/, Windows Stable} +@item +@c @uref{http://home.austin.rr.com/jbr/jeff/lilypond/, Windows Stable} @c @item @uref{ftp://ftp.lilypond.org/pub/lilypond/gnu-windows, Windows @c Testing} @uref{http://www.lilypond.org/gnu-windows/, Windows Testing} diff --git a/VERSION b/VERSION index e1a0089033..1ce83b9557 100644 --- a/VERSION +++ b/VERSION @@ -2,7 +2,7 @@ PACKAGE_NAME=LilyPond MAJOR_VERSION=1 MINOR_VERSION=4 PATCH_LEVEL=2 -MY_PATCH_LEVEL=jcn3 +MY_PATCH_LEVEL=jcn4 # use the above to send patches: MY_PATCH_LEVEL is always empty for a # released version. diff --git a/input/regression/easy-notation.ly b/input/regression/easy-notation.ly index 348aff0cbe..42a6f8edab 100644 --- a/input/regression/easy-notation.ly +++ b/input/regression/easy-notation.ly @@ -1,13 +1,14 @@ \version "1.3.146" \header { -texidoc = " Ez-notation prints names in note heads." +texidoc = " Ez-notation prints names in note heads. +You also get ledger lines, of course." } \include "paper26.ly" \paper { \paperTwentysix } \score { - \notes { c'2 e'4 f' | g'1 } + \notes { c'2 e'4 f' | g'1 b8 } \paper { \translator { \EasyNotation } } } diff --git a/lily/include/note-head.hh b/lily/include/note-head.hh index 833a86f6ac..f44eba230e 100644 --- a/lily/include/note-head.hh +++ b/lily/include/note-head.hh @@ -21,6 +21,7 @@ class Note_head { public: DECLARE_SCHEME_CALLBACK (brew_molecule, (SCM )); + static Molecule ledger_lines (Grob*,int,Direction,Interval); static Molecule ledger_line (Interval, Grob*) ; DECLARE_SCHEME_CALLBACK (brew_ez_molecule, (SCM )); static bool has_interface (Grob*); diff --git a/lily/note-head.cc b/lily/note-head.cc index 37b75e13a6..f7ef57ecc9 100644 --- a/lily/note-head.cc +++ b/lily/note-head.cc @@ -51,6 +51,29 @@ Note_head::ledger_line (Interval xwid, Grob *me) } +Molecule +Note_head::ledger_lines (Grob*me, int count, Direction dir, Interval idw) +{ + Real inter_f = Staff_symbol_referencer::staff_space (me)/2; + Molecule ledger (ledger_line (idw, me)); + + ledger.set_empty (true); + Real offs = (Staff_symbol_referencer::on_staffline (me)) + ? 0.0 + : -dir * inter_f; + + Molecule legs; + for (int i=0; i < count; i++) + { + Molecule s (ledger); + s.translate_axis (-dir * inter_f * i*2 + offs, + Y_AXIS); + legs.add_molecule (s); + } + + return legs; +} + MAKE_SCHEME_CALLBACK (Note_head,brew_molecule,1); SCM @@ -58,8 +81,6 @@ Note_head::brew_molecule (SCM smob) { Grob *me = unsmob_grob (smob); - - Real inter_f = Staff_symbol_referencer::staff_space (me)/2; int sz = Staff_symbol_referencer::line_count (me)-1; int p = (int) rint (Staff_symbol_referencer::position_f (me)); int streepjes_i = abs (p) < sz @@ -89,23 +110,11 @@ Note_head::brew_molecule (SCM smob) Direction dir = (Direction)sign (p); Interval hd = out.extent (X_AXIS); Real hw = hd.length ()/4; - Molecule ledger (ledger_line (Interval (hd[LEFT] - hw, - hd[RIGHT] + hw), me)); - - - ledger.set_empty (true); - Real offs = (Staff_symbol_referencer::on_staffline (me)) - ? 0.0 - : -dir * inter_f; - - for (int i=0; i < streepjes_i; i++) - { - Molecule s (ledger); - s.translate_axis (-dir * inter_f * i*2 + offs, - Y_AXIS); - out.add_molecule (s); - } + out.add_molecule (ledger_lines (me, streepjes_i, dir, + Interval (hd[LEFT] - hw, + hd[RIGHT] + hw))); } + return out.smobbed_copy (); } @@ -132,7 +141,23 @@ Note_head::brew_ez_molecule (SCM smob) SCM_UNDEFINED); Box bx (Interval (0, 1.0), Interval (-0.5, 0.5)); Molecule m (bx, at); + int p = (int) rint (Staff_symbol_referencer::position_f (me)); + int sz = Staff_symbol_referencer::line_count (me)-1; + int streepjes_i = abs (p) < sz + ? 0 + : (abs (p) - sz) /2; + + if (streepjes_i) + { + Direction dir = (Direction)sign (p); + Interval hd = m.extent (X_AXIS); + Real hw = hd.length ()/4; + m.add_molecule (ledger_lines (me, streepjes_i, dir, + Interval (hd[LEFT] - hw, + hd[RIGHT] + hw))); + } + return m.smobbed_copy (); } -- 2.39.2