+1.3.63.uu1
+==========
+
+* Lyrics centered on notehead.
+
+* Removed Clef_item as score-element derived type.
+
1.3.61.jcn2
===========
</td></tr>
<tr><td><font size=-1>
<a href="ftp://ftp.gnu.org/pub/gnu/lilypond">Stable</a><br>
- <a href="ftp://ftp.cs.uu.nl/pub/gnu/LilyPond/development">Development</a><br>
+ <a href="ftp://ftp.cs.uu.nl/pub/GNU/LilyPond/development">Development</a><br>
<br>
</td></tr>
<tr><td bgcolor="#e8e8ff">
MAJOR_VERSION=1
MINOR_VERSION=3
PATCH_LEVEL=63
-MY_PATCH_LEVEL=
+MY_PATCH_LEVEL=uu1
# use the above to send patches: MY_PATCH_LEVEL is always empty for a
# released version.
PostScript files were generated using TeX, Ghostscript and some
graphics tools. The papersize used for these examples is A4.
The images are in PNG format, and should be viewable with any current browser.
-We don't use GIFS due to <a href="http://www.gnu.org/philosophy/gif.html">patent problems</a>.
<p>
-If you want an accurate impression of the output quality please <em>print
-out</em> the samples first.
-"""
-
-headertext_nopics = r"""This is a subdirectory of the LilyPond example
-set. We decided not to show any examples from this directory. If you
-want to view them, then you have to download LilyPond and compile them
-yourself."""
+These images are generated at approximately 180dpi. If you want a better impression of the appearance do print out one the postscript version of the samples."""
#
--- /dev/null
+
+
+\score {
+ \notes \relative c'' < \context Voice {
+% c16 c16 c16 c16 c4
+ c4 c4 c4
+ }
+\context Lyrics \lyrics { foobar4 -- VAVAVAVAV4 -- foobar4 } >
+
+
+ \paper { linewidth = -10.0\cm; }
+}
text = \lyrics{
\property Lyrics . textStyle = "italic"
- Ah!4 vous dir- ai- je ma man2
- Ce4 qui cau- se mon tour- ment2
- Pa-4 pa veut que je rai- so- nne
- Comme4 un- e grand- e per- so- nne
- Moi4 je dis que les bon- bons2
- Val-4 ent mieux que la rai- son2
+ Ah!4 vous dir -- ai -- je ma man2
+ Ce4 qui cau -- se mon tour -- ment2
+ Pa4 -- pa veut que je rai -- so -- nne
+ Comme4 un -- e grand -- e per -- so -- nne
+ Moi4 je dis que les bon -- bons2
+ Val4 -- ent mieux que la rai -- son2
}
#include "staff-symbol-referencer.hh"
#include "bar.hh"
-#include "clef-item.hh"
+
#include "debug.hh"
#include "command-request.hh"
#include "timing-translator.hh"
/// where is c-0 in the staff?
class Clef_engraver : public Engraver {
- Clef_item * clef_p_;
+ Item * clef_p_;
Item * octavate_p_;
Clef_change_req * clef_req_l_;
{
if (!clef_p_)
{
- Clef_item *c= new Clef_item ( current_settings_);
+ Item *c= new Item ( current_settings_);
announce_element (Score_element_info (c, clef_req_l_));
Staff_symbol_referencer_interface si(c);
#include "molecule.hh"
#include "item.hh"
-Clef_item::Clef_item (SCM s)
- : Item (s)
-{}
+
+/**
+ Set a clef in a staff.
+
+ properties:
+
+ non-default -- not set because of existence of a bar?
+
+ change -- is this a change clef (smaller size)?
+
+ glyph -- a string determining what glyph is typeset
+
+ */
+struct Clef
+{
+ static SCM before_line_breaking (SCM);
+};
/*
FIXME: should use symbol.
-FIXME: this should be schemified.
*/
-GLUE_SCORE_ELEMENT(Clef_item,before_line_breaking);
+MAKE_SCHEME_SCORE_ELEMENT_CALLBACK(Clef,before_line_breaking);
SCM
-Clef_item::member_before_line_breaking ()
+Clef::before_line_breaking (SCM smob)
{
- SCM style_sym =get_elt_property ("style");
+ Item * s = dynamic_cast<Item*> (unsmob_element (smob));
+
+ SCM style_sym =s->get_elt_property ("style");
String style;
if (gh_string_p (style_sym))
style = ly_scm2string (style_sym);
- SCM glyph = get_elt_property ("glyph");
+ SCM glyph = s->get_elt_property ("glyph");
if (gh_string_p (glyph))
{
- String s = ly_scm2string (glyph);
+ String str = ly_scm2string (glyph);
/*
FIXME: should use fontsize property to set clef changes.
*/
- if (get_elt_property ("non-default") &&
- break_status_dir() != RIGHT && style != "fullSizeChanges")
+ if (s->get_elt_property ("non-default") &&
+ s->break_status_dir() != RIGHT && style != "fullSizeChanges")
{
- s += "_change";
- set_elt_property ("glyph", ly_str02scm (s.ch_C()));
+ str += "_change";
+ s->set_elt_property ("glyph", ly_str02scm (str.ch_C()));
}
}
else
{
- suicide ();
+ s->suicide ();
return SCM_UNDEFINED;
}
- // ugh.
- /* why not suicide? */
- if (style == "transparent") // UGH. JUNKME
- {
- set_elt_property ("molecule-callback", SCM_BOOL_T);
- set_extent_callback (0, X_AXIS);
- }
-
return SCM_UNDEFINED;
}
#include "proto.hh"
#include "musical-request.hh"
-#include "extender-spanner.hh"
+#include "lyric-extender.hh"
#include "paper-column.hh"
#include "item.hh"
#include "engraver.hh"
#include "drul-array.hh"
-#include "extender-spanner.hh"
+#include "lyric-extender.hh"
#include "pqueue.hh"
then. */
class Extender_engraver : public Engraver
{
- Item * last_lyric_l_;
- Item * current_lyric_l_;
+ Score_element *last_lyric_l_;
+ Score_element *current_lyric_l_;
Extender_req* req_l_;
Spanner* extender_p_;
public:
Extender_engraver::acknowledge_element (Score_element_info i)
{
// -> text_item
- if (Item* t = dynamic_cast<Item*> (i.elem_l_))
+ if (dynamic_cast<Item*> (i.elem_l_)
+ && to_boolean (i.elem_l_->get_elt_property ("text-item-interface")))
{
- current_lyric_l_ = t;
+ current_lyric_l_ = i.elem_l_;
if (extender_p_
&& !extender_p_->get_bound (RIGHT)
)
{
- Lyric_extender(extender_p_).set_textitem (RIGHT, t);
+ Lyric_extender(extender_p_).set_textitem (RIGHT, dynamic_cast<Item*> (i.elem_l_));
}
}
}
then. */
class Hyphen_engraver : public Engraver
{
- Item *last_lyric_l_;
- Item *current_lyric_l_;
+ Score_element *last_lyric_l_;
+ Score_element *current_lyric_l_;
Hyphen_req* req_l_;
Spanner* hyphen_p_;
public:
void
Hyphen_engraver::acknowledge_element (Score_element_info i)
{
-
// -> text-item
- if (Item* t = dynamic_cast<Item*> (i.elem_l_))
+ if (dynamic_cast<Item*> (i.elem_l_)
+ && to_boolean (i.elem_l_->get_elt_property ("text-item-interface")))
{
- current_lyric_l_ = t;
+ current_lyric_l_ = i.elem_l_;
if (hyphen_p_
&& !hyphen_p_->get_bound (RIGHT)
)
{
- Hyphen_spanner (hyphen_p_).set_textitem (RIGHT, t);
+ Hyphen_spanner (hyphen_p_).set_textitem (RIGHT, i.elem_l_);
}
}
}
(c) 1999 Glen Prideaux <glenprideaux@iname.com>
- (adapted from extender-spanner)
+ (adapted from lyric-extender)
*/
#include <math.h>
SCM
Hyphen_spanner::brew_molecule (SCM smob)
{
- Spanner * sp =dynamic_cast<Spanner*> (unsmob_element (smob));
- Molecule mol;
+ Spanner * sp = dynamic_cast<Spanner*> (unsmob_element (smob));
- Real leftext = sp->get_bound (LEFT)->extent (X_AXIS).length ();
+ Score_element * common = sp;
+ Direction d = LEFT;
+ do
+ {
+ common = common->common_refpoint( sp->get_bound (d), X_AXIS);
+ }
+ while (flip (&d) != LEFT);
+ Interval bounds;
+
+ do
+ {
+ Real x = sp->get_bound (d)->relative_coordinate (common, X_AXIS);
+ Interval ext = sp->get_bound (d)->extent (X_AXIS);
+ bounds[d] = (x + ext[-d]);
+ }
+ while (flip (&d) != LEFT);
+
+
Real ss = sp->paper_l ()->get_var ("staffspace");
Real lt = sp->paper_l ()->get_var ("stafflinethickness");
Real th = gh_scm2double (sp->get_elt_property ("thickness")) * lt ;
Real h = gh_scm2double (sp->get_elt_property ("height")) * ss;
Real l = gh_scm2double (sp->get_elt_property ("minimum-length")) * ss;
- Real w = sp->spanner_length () - leftext - ss/2;
-
-
+ Real w = bounds.length ();
/* First try: just make the hyphen take 1/3 of the available space
for length, use a geometric mean of the available space and some minimum
*/
if(l < w)
l = sqrt(l*w);
- Box b (Interval ( (w-l)/2, (w+l)/2), Interval (h,h+th));
- mol.add_molecule (sp->lookup_l ()->filledbox (b));
- mol.translate_axis(leftext, X_AXIS);
+ Box b (Interval (-l/2,l/2), Interval (h,h+th));
+ Molecule mol (sp->lookup_l ()->filledbox (b));
+ mol.translate_axis (bounds.center ()
+ -sp->relative_coordinate (common, X_AXIS),
+ X_AXIS);
return mol.create_scheme ();
}
void
-Hyphen_spanner::set_textitem (Direction d, Item* textitem_l)
+Hyphen_spanner::set_textitem (Direction d, Score_element* b)
{
- elt_l_->set_bound (d, textitem_l);
- elt_l_->add_dependency (textitem_l);
+ elt_l_->set_bound (d, b);
+ elt_l_->add_dependency (b);
}
Hyphen_spanner::Hyphen_spanner (Spanner*s)
#include "direction.hh"
-/**
- Set a clef in a staff.
-
- properties:
-
- non-default -- not set because of existence of a bar?
-
- change -- is this a change clef (smaller size)?
-
- glyph -- a string determining what glyph is typeset
-
- */
-class Clef_item : public Item
-{
-public:
- SCM member_before_line_breaking ();
- static SCM before_line_breaking (SCM);
-
- VIRTUAL_COPY_CONS(Score_element);
- Clef_item (SCM);
-};
#endif // CLEFITEM_HH
-/*
- extender-spanner.hh -- part of GNU LilyPond
-
- (c) 1998--2000 Jan Nieuwenhuizen <janneke@gnu.org>
-*/
-
-#ifndef EXTENDER_SPANNER_HH
-#define EXTENDER_SPANNER_HH
-
-#include "spanner.hh"
-
-/**
- simple extender line
-
- The extender is a simple line at the baseline of the lyric
- that helps show the length of a melissima (tied/slurred note).
-
- Extenders must be entered manually for now.
-
- Although it would be possible for Lily to determine where to
- put extender lines, it's quite a tricky thing to do. Also,
- this would demand quite strict lyrics entries.
-
- Note: the extender is only used for one-syllable words, or
- for on a word's last syllable. The extender should be aligned
- with the left side of the last note of the melissima, and not
- extend beond, lasting the whole duration of the melissima
- (as in MUP, urg).
- */
-class Lyric_extender // interface
-{
-public:
- Spanner*elt_l_;
- Lyric_extender (Spanner*);
- void set_textitem (Direction, Item*);
- static SCM brew_molecule (SCM);
-};
-
-#endif // EXTENDER_SPANNER_HH
+#error
public:
Spanner* elt_l_;
Hyphen_spanner (Spanner*);
- void set_textitem (Direction, Item*);
+ void set_textitem (Direction, Score_element*);
static SCM brew_molecule (SCM);
};
--- /dev/null
+
+/*
+ extender-spanner.hh -- part of GNU LilyPond
+
+ (c) 1998--2000 Jan Nieuwenhuizen <janneke@gnu.org>
+*/
+
+#ifndef EXTENDER_SPANNER_HH
+#define EXTENDER_SPANNER_HH
+
+#include "spanner.hh"
+
+/**
+ simple extender line
+
+ The extender is a simple line at the baseline of the lyric
+ that helps show the length of a melissima (tied/slurred note).
+
+ Extenders must be entered manually for now.
+
+ Although it would be possible for Lily to determine where to
+ put extender lines, it's quite a tricky thing to do. Also,
+ this would demand quite strict lyrics entries.
+
+ Note: the extender is only used for one-syllable words, or
+ for on a word's last syllable. The extender should be aligned
+ with the left side of the last note of the melissima, and not
+ extend beond, lasting the whole duration of the melissima
+ (as in MUP, urg).
+ */
+class Lyric_extender // interface
+{
+public:
+ Spanner*elt_l_;
+ Lyric_extender (Spanner*);
+ void set_textitem (Direction, Score_element*);
+ static SCM brew_molecule (SCM);
+};
+
+#endif // EXTENDER_SPANNER_HH
+
// TODO: make virtual and do this for Items as well.
Interval_t<int> spanned_rank_iv ();
- void set_bound (Direction d, Item*);
+ void set_bound (Direction d, Score_element*);
Item *get_bound (Direction d) const;
Spanner (SCM);
#include "engraver.hh"
#include "musical-pitch.hh"
#include "protected-scm.hh"
-#include "clef-item.hh"
+
/**
Make the key signature.
void
Key_engraver::acknowledge_element (Score_element_info info)
{
- if (dynamic_cast <Clef_item *> (info.elem_l_))
+ if (to_boolean (info.elem_l_->get_elt_property ("clef-interface")))
{
SCM c = get_property ("createKeyOnClefChange");
if (to_boolean (c))
#include "item.hh"
#include "paper-def.hh"
#include "lookup.hh"
+#include "side-position-interface.hh"
ADD_THIS_TRANSLATOR (Lyric_engraver);
text_p_->set_elt_property ("text",
ly_str02scm ((req_l_->text_str_ + " ").ch_C ()));
+ text_p_->add_offset_callback (&Side_position_interface::aligned_on_self,X_AXIS);
+ /*
+ We can't reach the notehead where we're centered from here. So
+ we kludge.
+ */
+ text_p_->translate_axis (paper_l()->get_var ("quartwidth")/2, X_AXIS);
+
announce_element (Score_element_info (text_p_, req_l_));
}
}
#include "molecule.hh"
#include "paper-column.hh"
#include "paper-def.hh"
-#include "extender-spanner.hh"
+#include "lyric-extender.hh"
MAKE_SCHEME_SCORE_ELEMENT_CALLBACK(Lyric_extender,brew_molecule)
}
void
-Lyric_extender::set_textitem (Direction d, Item* textitem_l)
+Lyric_extender::set_textitem (Direction d, Score_element*s)
{
- elt_l_->set_bound (d, textitem_l);
- elt_l_->add_dependency (textitem_l);
+ elt_l_->set_bound (d, s);
+ elt_l_->add_dependency (s);
}
Lyric_extender::Lyric_extender (Spanner*s)
#include <ctype.h>
#include "bar.hh"
-#include "clef-item.hh"
#include "command-request.hh"
#include "dimension-cache.hh"
#include "engraver-group-engraver.hh"
}
void
-Spanner::set_bound(Direction d, Item*i)
+Spanner::set_bound(Direction d, Score_element*s)
{
+ Item * i = dynamic_cast<Item*> (s);
+ if (!i)
+ {
+ programming_error ("Must have Item for spanner bound.");
+ return;
+ }
+
spanned_drul_[d] =i;
/**
)
basicClefItemProperties = #`(
(molecule-callback . ,Score_element::brew_molecule)
- (before-line-breaking-callback . ,Clef_item::before_line_breaking)
+ (before-line-breaking-callback . ,Clef::before_line_breaking)
(breakable . #t)
(break-align-symbol . Clef_item)
- (visibility-lambda . ,begin-of-line-visible)
+ (visibility-lambda . ,begin-of-line-visible)
+ (clef-interface . #t)
)
basicSlurProperties = #`(
(molecule-callback . ,Slur::brew_molecule)
)
basicLyricTextProperties = #`(
(molecule-callback . ,Text_item::brew_molecule)
+ (self-alignment-X . 0)
(non-rhythmic . #t)
+ (text-item-interface . #t)
)
basicMarkProperties = #`(
(molecule-callback . ,Text_item::brew_molecule)