backend directly. See the init file @file{generic-property.scm} for
details. For internal use only.
+
+@item @code{XXXVerticalExtent}@indexcode{groupVerticalExtent}
+@propertytype{Interval: a cons of numbers}
+
+ Hard code the size of the vertical group in context XXX, example
+@example
+ \property Staff.StaffVerticalExtent = #(-5.0 . 5.0)
+@end example
+ The value is a cons of real numbers, that measure the extent in
+staff spaces
+
+
@cindex properties!Lyrics
@table @samp
--- /dev/null
+\include "paper-as5.ly"
+
+\score {
+ \notes\relative c''{
+ \time 4/4;
+ g1 a b c
+ g2 a b c
+ g4 a b c
+ }
+ \paper {
+ \paper_as_five
+ \translator { \StaffContext barSize = #5 }
+ }
+
+}
+
--- /dev/null
+\version "1.3.5";
+
+$somewhat_long = \lyrics{
+ \property Lyrics . textStyle = "roman"
+ AaaaaaA2
+ BbbbbbB2
+ CcccccC2
+ DdddddD2
+ EeeeeeE2
+ FfffffF2
+}
+
+$rather_long = \lyrics{
+ \property Lyrics . textStyle = "roman"
+ LLLLoooonggggg2
+ Syyllllaaabbble2
+ LLLLoooonggggg2
+ Syyllllllaaabbble2
+ LLLLoooonggggg2
+ Syyyylllaaabbble2
+}
+
+$quite_long = \lyrics{
+ \property Lyrics . textStyle = "roman"
+ LLLLLLLLLooooongggggggg2
+ Syyyyyyyyyyyyylllllllaaaaaabbble2
+ LLLLLLLLLooooongggggggg2
+ Syyyyyyyyyyyyylllllllaaaaaabbble2
+ LLLLLLLLLooooongggggggg2
+ Syyyyyyyyyyyyylllllllaaaaaabbble2
+}
+
+$somewhat_long_lyrics_staff = \context Lyrics = somewhat <
+ \$somewhat_long
+>
+
+$rather_long_lyrics_staff = \context Lyrics = rather <
+ \$rather_long
+>
+
+$quite_long_lyrics_staff = \context Lyrics = quite <
+ \$quite_long
+>
+
+melody = \notes
+\transpose c'{
+ c4 e4 g4 e4 c4 e4 g4 e4 c4 e4 g4 e4 c4 e4 g4 e4
+ c4 e4 g4 e4 c4 e4 g4 e4 c4 e4 g4 e4 c4 e4 g4 e4
+}
+
+$melodic_staff = \context Staff = mel <
+ \melody
+>
+
+\score
+{
+ <
+ \$melodic_staff
+ \$somewhat_long_lyrics_staff
+% \$rather_long_lyrics_staff
+ \$quite_long_lyrics_staff
+ >
+ \paper{
+% castingalgorithm = \Wordwrap;
+ }
+}
--- /dev/null
+
+\score {
+\notes \context Staff {
+ \property Staff.StaffVerticalExtent = #'(-15.0 . 15.0)
+ c1 \break c1
+}
+}
#include "spanner.hh"
#include "paper-column.hh"
#include "axis-group-interface.hh"
+#include "dimension-cache.hh"
+#include "engraver-group-engraver.hh"
Axis_group_engraver::Axis_group_engraver ()
{
void
Axis_group_engraver::do_removal_processing ()
{
+ String name = daddy_grav_l ()->type_str_ + "VerticalExtent";
+ SCM dims = get_property (name);
+
+ if (gh_pair_p (dims) && gh_number_p (gh_car (dims))
+ && gh_number_p (gh_cdr (dims)))
+ {
+ staffline_p_->dim_cache_[Y_AXIS]->set_extent_callback (&Score_element::preset_extent);
+ staffline_p_->set_elt_property ("extent-Y", dims);
+ }
+
staffline_p_->set_bound(RIGHT,get_staff_info().command_pcol_l ());
typeset_element (staffline_p_);
staffline_p_ = 0;
if (a1 != Y_AXIS && a2 != Y_AXIS)
elt_l_->set_empty (Y_AXIS);
- elt_l_->dim_cache_[a1]->set_callback (Axis_group_interface::group_extent_callback);
- elt_l_->dim_cache_[a2]->set_callback (Axis_group_interface::group_extent_callback);
+ elt_l_->dim_cache_[a1]->set_extent_callback (Axis_group_interface::group_extent_callback);
+ elt_l_->dim_cache_[a2]->set_extent_callback (Axis_group_interface::group_extent_callback);
}
Link_array<Score_element>
}
void
-Dimension_cache::set_callback (Dim_cache_callback c)
+Dimension_cache::set_extent_callback (Dim_cache_callback c)
{
extent_callback_l_ =c;
}
: Spanner ()
{
dx_f_drul_[LEFT] = dx_f_drul_[RIGHT] = 0.0;
- dim_cache_[Y_AXIS]->set_callback (Dimension_cache::point_dimension_callback);
+ dim_cache_[Y_AXIS]->set_extent_callback (Dimension_cache::point_dimension_callback);
}
{
dx_f_drul_[LEFT] = dx_f_drul_[RIGHT] = 0.0;
- dim_cache_[Y_AXIS]->set_callback (Dimension_cache::point_dimension_callback);
+ dim_cache_[Y_AXIS]->set_extent_callback (Dimension_cache::point_dimension_callback);
}
Molecule
static Interval point_dimension_callback (Dimension_cache const* );
Axis axis () const;
Real get_offset () const;
- void set_callback (Dim_cache_callback);
+ void set_extent_callback (Dim_cache_callback);
Dimension_cache * parent_l_;
Score_element *element_l () const { return elt_l_; }
void add_dependency (Score_element*);
virtual Line_of_score * line_l () const;
bool linked_b () const;
+
+
VIRTUAL_COPY_CONS(Score_element);
/**
/// do calculations before determining horizontal spacing
virtual void before_line_breaking ();
+ static Interval preset_extent (Dimension_cache const*);
+ static Interval molecule_extent (Dimension_cache const*);
+
protected:
/**
virtual ~Score_element ();
virtual void output_processing ();
- static Interval molecule_extent (Dimension_cache const*);
-
+
/// do printing of derived info.
virtual void do_print () const;
/// generate the molecule
yylval.pitch->set_spot (Input (source_file_l (),
here_ch_C ()));
return (YYSTATE == notes) ? NOTENAME_PITCH : TONICNAME_PITCH;
- } else if ((pitch = scm_hashq_ref (pitchname_tab_, sym, SCM_BOOL_F))!= SCM_BOOL_F)
+ } else if ((pitch = scm_hashq_ref (chordmodifier_tab_, sym, SCM_BOOL_F))!= SCM_BOOL_F)
{
yylval.pitch = new Musical_pitch (pitch);
yylval.pitch->set_spot (Input (source_file_l (),
*/
line_l_->output_lines ();
-
SCM font_names = ly_quote_scm (all_fonts_global_p->font_descriptions ());
gh_set_cdr_x (before_output,
gh_cons (gh_list (ly_symbol2scm ("define-fonts"),
{
Score_element * se = unsmob_element (e);
se->fixup_refpoint ();
-
+
if (!dynamic_cast<Line_of_score*> (se) && !se->parent_l (Y_AXIS))
{
programming_error ("No parent!");
#include "dimension-cache.hh"
#include "side-position-interface.hh"
#include "item.hh"
-
/*
TODO:
// junkme.
used_b_ = false;
- dim_cache_[X_AXIS]->set_callback (molecule_extent);
- dim_cache_[Y_AXIS]->set_callback (molecule_extent);
+ dim_cache_[X_AXIS]->set_extent_callback (molecule_extent);
+ dim_cache_[Y_AXIS]->set_extent_callback (molecule_extent);
used_b_ = false;
pscore_l_=0;
lookup_l_ =0;
}
Interval
-Score_element::molecule_extent(Dimension_cache const *c)
+Score_element::molecule_extent (Dimension_cache const *c)
{
Score_element *s = dynamic_cast<Score_element*>(c->element_l());
Molecule m = s->do_brew_molecule();
- return m.extent()[c->axis ()];
+ return m.extent()[c->axis ()];
+}
+
+Interval
+Score_element::preset_extent (Dimension_cache const *c)
+{
+ Score_element *s = dynamic_cast<Score_element*>(c->element_l());
+ SCM ext = s->get_elt_property ((c->axis () == X_AXIS)
+ ? "extent-X"
+ : "extent-Y");
+
+ if (gh_pair_p (ext))
+ {
+ Real l = gh_scm2double (gh_car (ext));
+ Real r = gh_scm2double (gh_cdr (ext));
+ l *= s->paper_l ()->get_var ("staffspace");
+ r *= s->paper_l ()->get_var ("staffspace");
+ return Interval (l, r);
+ }
+
+ return Interval ();
}
if (!parent)
continue;
- if (parent->line_l () != line_l ())
+ if (parent->line_l () != line_l () && line_l ())
{
Score_element * newparent = parent->find_broken_piece (line_l ());
set_parent (newparent, ax);
Span_bar::Span_bar ()
{
group (this).set_interface ();
- dim_cache_[X_AXIS]->set_callback (width_callback);
- dim_cache_[Y_AXIS]->set_callback (height_callback);
+ dim_cache_[X_AXIS]->set_extent_callback (width_callback);
+ dim_cache_[Y_AXIS]->set_extent_callback (height_callback);
}
Volta_spanner::Volta_spanner ()
{
- //dim_cache_ [Y_AXIS]->set_callback (dim_callback);
set_elt_property ("bars", SCM_EOL);
side_position (this).set_axis (Y_AXIS);
directional_element (this).set (UP);
}
+
+/*
+ this is too complicated. Yet another version of side-positioning,
+ badly implemented. */
Molecule
Volta_spanner::do_brew_molecule () const
{
\type "Engraver_group_engraver";
\name Lyrics;
\consists Vertical_align_engraver;%need this for getting folded repeats right.
-
+ Generic_property_list = #generic-lyrics-properties
\consists "Property_engraver";
\consistsend "Axis_group_engraver";
))
)
+
+
+
+
+;;;;;;;;;;
+;; don't forget to add these to the Generic_property_list property in
+;; engraver.ly
+
(define generic-voice-properties
(list
generic-stem-properties
(define generic-lyrics-properties
(list generic-text-properties
)
-
)