noteheads on this stem.
* lily/note-spacing.cc (stem_dir_correction): robustness fix:
don't crash on stemlet (visible stem without heads).
* scm/define-grobs.scm (all-grob-descriptions): junk LeftEdge for
unbroken situations.
* scm/output-lib.scm (center-invisible): new function.
* lily/spacing-loose-columns.cc (set_loose_columns): use spacing
wishes to determine loose column space.
2005-03-09 Han-Wen Nienhuys <hanwen@xs4all.nl>
+ * lily/stem.cc (print): only produce stemlets if there are no
+ noteheads on this stem.
+
+ * lily/note-spacing.cc (stem_dir_correction): robustness fix:
+ don't crash on stemlet (visible stem without heads).
+
+ * scm/define-grobs.scm (all-grob-descriptions): junk LeftEdge for
+ unbroken situations.
+
+ * scm/output-lib.scm (center-invisible): new function.
+
+ * lily/spacing-loose-columns.cc (set_loose_columns): use spacing
+ wishes to determine loose column space.
+
* lily/font-config.cc (init_fontconfig): add
fonts/{otf,type1,cff} to path.
\context {
\Lyrics
minimumVerticalExtent = #'(-0.5 . 2.5)
+ \override LyricText #'font-size = #-1
}
\context {
\Score
\relative {
\override Stem #'stemlet-length = #0.75
c8[ r8 c16 r16 c8]
+ c4
}
protected:
};
+
+void set_loose_columns (System* which, Column_x_positions const *posns);
#endif /* SYSTEM_HH */
}
Interval hp = Stem::head_positions (stem);
- Real chord_start = hp[sd];
- Real stem_end = Stem::stem_end_position (stem);
+ if (!hp.is_empty())
+ {
+ Real chord_start = hp[sd];
+ Real stem_end = Stem::stem_end_position (stem);
- stem_posns[d] = Interval (chord_start<?stem_end, chord_start>? stem_end);
- head_posns[d].unite (hp);
+ stem_posns[d] = Interval (chord_start <? stem_end, chord_start>? stem_end);
+ head_posns[d].unite (hp);
+ }
}
}
while (flip (&d) != LEFT);
--- /dev/null
+/*
+ spacing-loose-columns.cc -- implement loose column spacing.
+
+ source file of the GNU LilyPond music typesetter
+
+ (c) 2005 Han-Wen Nienhuys <hanwen@xs4all.nl>
+
+*/
+
+#include "system.hh"
+#include "paper-column.hh"
+#include "column-x-positions.hh"
+#include "staff-spacing.hh"
+
+
+/* Find the loose columns in POSNS, and drape them around the columns
+ specified in BETWEEN-COLS. */
+void
+set_loose_columns (System* which, Column_x_positions const *posns)
+{
+ int loose_col_count = posns->loose_cols_.size ();
+ for (int i = 0; i < loose_col_count; i++)
+ {
+ int divide_over = 1;
+ Item *loose = dynamic_cast<Item*> (posns->loose_cols_[i]);
+ Paper_column* col = dynamic_cast<Paper_column*> (loose);
+
+ if (col->system_)
+ continue;
+
+ Item *left = 0;
+ Item *right = 0;
+ while (1)
+ {
+ SCM between = loose->get_property ("between-cols");
+ if (!scm_is_pair (between))
+ break;
+
+ Item *le = dynamic_cast<Item*> (unsmob_grob (scm_car (between)));
+ Item *re = dynamic_cast<Item*> (unsmob_grob (scm_cdr (between)));
+
+ if (!(le && re))
+ break;
+
+ if (!left && le)
+ {
+ left = le->get_column ();
+ if (!left->get_system ())
+ left = left->find_prebroken_piece (RIGHT);
+ }
+
+ divide_over++;
+ loose = right = re->get_column ();
+ }
+
+ if (!right->get_system ())
+ right = right->find_prebroken_piece (LEFT);
+
+ Grob *common = right->common_refpoint (left, X_AXIS);
+
+ int count = 0;
+ Real total_space = 0.0;
+ Real total_fixed = 0.0;
+ for (SCM wish = col->get_property ("spacing-wishes"); scm_is_pair (wish); wish = scm_cdr (wish))
+ {
+ Grob *spacing = unsmob_grob (scm_car (wish));
+ if (Staff_spacing::has_interface (spacing))
+ {
+ Real space = 0.0;
+ Real fixed = 0.0;
+ Staff_spacing::get_spacing_params (spacing, &space, &fixed);
+
+ total_fixed += fixed;
+ total_space += space;
+ count ++;
+ }
+ }
+
+ Real right_point = 0.0;
+ Real distance_to_next = 0.0;
+ if (count)
+ {
+ total_space /= count;
+ total_fixed /= count;
+
+ distance_to_next = total_space;
+ right_point = right->relative_coordinate (common, X_AXIS);
+ }
+ else
+ {
+ Interval my_extent = col->extent (col, X_AXIS);
+ distance_to_next = my_extent[RIGHT] + 1.0;
+ right_point = right->extent (common, X_AXIS)[LEFT];
+ }
+#if 0
+ Real left_point = left->extent (common, X_AXIS)[RIGHT];
+
+ Real space_left = ((right_point - left_point) >? 0.0)
+ - (my_extent.is_empty() ? 0.0 : my_extent.length ());
+
+ Real padding = (space_left / 2) <? 1.0;
+ /*
+ Put it just left of the right column, with a bit of extra space
+ */
+#endif
+ Real my_offset = right_point - distance_to_next;
+
+ col->system_ = which;
+ col->translate_axis (my_offset - col->relative_coordinate (common, X_AXIS), X_AXIS);
+ }
+}
+
*/
/*
- we used to have a warning here, but itgenerates a lot of
+ we used to have a warning here, but it generates a lot of
spurious error messages.
*/
return ;
Grob *lh =
to_boolean (me->get_property ("avoid-note-head"))
? last_head (me)
- : lh = first_head (me);
+ : first_head (me);
Grob *beam = get_beam (me);
if (!lh && !stemlet)
return SCM_EOL;
- if (stemlet && !beam)
+ if (!lh && stemlet && !beam)
return SCM_EOL;
if (is_invisible (me))
return lines;
}
-/* Find the loose columns in POSNS, and drape them around the columns
- specified in BETWEEN-COLS. */
-static void
-set_loose_columns (System* which, Column_x_positions const *posns)
-{
- int loose_col_count = posns->loose_cols_.size ();
- for (int i = 0; i < loose_col_count; i++)
- {
- int divide_over = 1;
- Item *loose = dynamic_cast<Item*> (posns->loose_cols_[i]);
- Paper_column* col = dynamic_cast<Paper_column*> (loose);
-
- if (col->system_)
- continue;
-
- Item *left = 0;
- Item *right = 0;
- while (1)
- {
- SCM between = loose->get_property ("between-cols");
- if (!scm_is_pair (between))
- break;
-
- Item *le = dynamic_cast<Item*> (unsmob_grob (scm_car (between)));
- Item *re = dynamic_cast<Item*> (unsmob_grob (scm_cdr (between)));
-
- if (!(le && re))
- break;
-
- if (!left && le)
- {
- left = le->get_column ();
- if (!left->get_system ())
- left = left->find_prebroken_piece (RIGHT);
- }
-
- divide_over++;
- loose = right = re->get_column ();
- }
-
- if (!right->get_system ())
- right = right->find_prebroken_piece (LEFT);
-
- /* Divide the remaining space of the column over the left and
- right side. At the moment, FIXME */
- Grob *common = right->common_refpoint (left, X_AXIS);
-
- Real right_point = right->extent (common, X_AXIS)[LEFT];
- Real left_point = left->extent (common, X_AXIS)[RIGHT];
- Interval my_extent = col->extent (col, X_AXIS);
-
- Real space_left = (right_point - left_point)
- - (my_extent.is_empty() ? 0.0 : my_extent.length ());
-
- Real padding = (space_left / 2) <? 1.0;
- /*
- Put it just left of the right column, with a bit of extra space
- */
- Real my_offset = right_point - my_extent[RIGHT] - padding;
-
- col->system_ = which;
- col->translate_axis (my_offset - col->relative_coordinate (common, X_AXIS), X_AXIS);
- }
-}
-
void
System::break_into_pieces (Array<Column_x_positions> const &breaking)
{
))
(DynamicTextSpanner
. ((print-function . ,Dynamic_text_spanner::print)
- (font-series . bold)
+
+;; rather ugh with NCSB
+; (font-series . bold)
(font-shape . italic)
(style . dashed-line)
; need to blend with dynamic texts.
- (font-size . 2)
+ (font-size . 1)
(bound-padding . 0.75)
(dash-fraction . 0.2)
(dash-period . 3.0)
(break-align-symbol . left-edge)
(X-extent . (0 . 0))
(breakable . #t)
+ (break-visibility . ,center-invisible)
(space-alist . (
(custos . (extra-space . 0.0))
(ambitus . (extra-space . 2.0))
(define-safe-public (all-visible d) '(#f . #f))
(define-safe-public (all-invisible d) '(#t . #t))
(define-safe-public (begin-of-line-invisible d) (if (= d 1) '(#t . #t) '(#f . #f)))
+(define-safe-public (center-invisible d) (if (= d 0) '(#t . #t) '(#f . #f)))
(define-safe-public (end-of-line-invisible d) (if (= d -1) '(#t . #t) '(#f . #f)))