2004-11-28 Han-Wen Nienhuys <hanwen@xs4all.nl>
+ * input/regression/spacing-stick-out.ly: new file.
+
+ * lily/simple-spacer.cc (add_columns): use binary search for
+ setting column rods. Changes O(n^2) to O(n log(n)) for
+ constructing spacing problem from columns.
+ (add_columns): read allow-outside-line to make sure no texts stick
+ out.
+ (solve): Simple_spacer::is_active() only determines
+ satisfies_constraints_ for non-ragged typesetting.
+
+ * lily/simultaneous-music.cc (to_relative_octave): only set
+ old_relative_used if return pitch actually changed.
+
+ * scm/define-context-properties.scm
+ (all-user-translation-properties): change to match implementation.
+
+ * python/lilylib.py: Replace re.match by re.search and adds "-c
+ showpage" to the gs command line (Johannes Schindelin)
+
+ * scm/framework-ps.scm (output-preview-framework): sanitize bbox
+ before processing. Prevents crash when inf is in the extent.
+
* scm/define-markup-commands.scm (note-by-number): add "s" to
"noteheads-" glyphname.
BUG HUNTERS/SUGGESTIONS
+Johannes Schindelin
Andreas Scherer
Arjan Bos
Fernando Pablo Lopez-Lezcano
*/
template<class T>
int
-binsearchs (Array<T> const &arr, T t, int (*compare) (T const&,T const&))
+binsearch (Array<T> const &arr, T t, int (*compare) (T const&,T const&))
{
int lo;
int hi;
*/
-#include "accidental-placement.hh"
-
#include <cmath>
+
+#include "accidental-placement.hh"
#include "libc-extension.hh" // isinf
#include "skyline.hh"
#include "music.hh"
if (!staffline_)
{
staffline_ = get_spanner ();
-
Grob * it = unsmob_grob (get_property ("currentCommandColumn"));
-
staffline_->set_bound (LEFT,it);
}
}
for (int i=0; i < elts_.size (); i++)
{
- Grob *par = elts_[i]->get_parent (Y_AXIS);
-
- if (!par || !Axis_group_interface::has_interface (par))
+ if (!unsmob_grob (elts_[i]->get_property ("axis-group-parent-Y")))
{
if (staffline_->get_parent (Y_AXIS)
&& staffline_->get_parent (Y_AXIS) == elts_[i])
*/
#include "axis-group-interface.hh"
-
#include "hara-kiri-group-spanner.hh"
void
if (!e->get_parent (a))
e->set_parent (me, a);
- }
+ e->internal_set_property ((a == X_AXIS)
+ ? ly_symbol2scm ("axis-group-parent-X")
+ : ly_symbol2scm ("axis-group-parent-Y"),
+ me->self_scm ()
+ );
+ }
+
Pointer_group_interface::add_grob (me, ly_symbol2scm ("elements"), e);
me->add_dependency (e);
}
(c) 1997--2004 Han-Wen Nienhuys <hanwen@cs.uu.nl>
*/
-#include "bar-line.hh"
#include <cmath>
+#include "bar-line.hh"
#include "lookup.hh"
#include "paper-column.hh"
#include "output-def.hh"
*/
-#include "beam.hh"
#include <cmath> // tanh.
+#include "beam.hh"
#include "interval-set.hh"
#include "directional-element-interface.hh"
#include "beaming.hh"
(c) 1998--2004 Jan Nieuwenhuizen <janneke@gnu.org>
*/
-#include "bezier.hh"
#include <cmath>
+#include "bezier.hh"
#include "warn.hh"
#include "libc-extension.hh"
(c) 1997--2004 Jan Nieuwenhuizen
*/
-
-#include "binary-source-file.hh"
-
#include <climits> // INT_MAX
+#include "binary-source-file.hh"
#include "string-convert.hh"
Binary_source_file::Binary_source_file (String& file_name_string)
(c) 1997--2004 Han-Wen Nienhuys <hanwen@cs.uu.nl>
*/
-#include "break-align-interface.hh"
#include <cmath>
+#include "break-align-interface.hh"
#include <libc-extension.hh> // isinf
#include "self-alignment-interface.hh"
*/
-#include "custos.hh"
-
#include <cstdio>
#include <cmath> // rint
+#include "custos.hh"
#include "direction.hh"
#include "staff-symbol-referencer.hh"
#include "warn.hh"
(c) 1998--2004 Han-Wen Nienhuys <hanwen@cs.uu.nl>
*/
-#include "dimension-cache.hh"
#include <cmath>
+#include "dimension-cache.hh"
#include "warn.hh"
#include "grob.hh"
return scm_c_memq (k, ifs) != SCM_BOOL_F;
}
+Grob*
+Grob::get_parent (Axis a) const
+{
+ return dim_cache_[a].parent_;
+}
+
+
/** Return Array of Grobs in SCM list LST */
Link_array<Grob>
ly_scm2grobs (SCM lst)
"Y-extent-callback print-function extra-offset spacing-procedure "
"context staff-symbol interfaces dependencies X-extent Y-extent extra-X-extent "
"meta layer before-line-breaking-callback "
+ "axis-group-parent-X "
+ "axis-group-parent-Y "
"after-line-breaking-callback extra-Y-extent minimum-X-extent "
"minimum-Y-extent transparent tweak-count tweak-rank"
);
+
void set_parent (Grob* e, Axis);
// URG
- Grob *get_parent (Axis a) const
- {
- return dim_cache_[a].parent_;
- }
-
+ Grob *get_parent (Axis a) const;
DECLARE_SCHEME_CALLBACK (fixup_refpoint, (SCM));
};
if (dynamic_cast<Item*> (elem))
{
- if (!elem->get_parent (X_AXIS)
+ if (
+ (!elem->get_parent (X_AXIS)
+ || !unsmob_grob (elem->get_property ("axis-group-parent-X")))
&& elem != command_column_
&& elem != musical_column_
)
positions->satisfies_constraints_ =
positions->config_.top () < spacer_->line_len_ ;
}
-
+ else
+ positions->satisfies_constraints_ = spacer_->is_active ();
positions->cols_ = spaced_cols_;
positions->loose_cols_ = loose_cols_;
- positions->satisfies_constraints_ =
- positions->satisfies_constraints_ && spacer_->is_active ();
/*
Check if breaking constraints are met.
springs_.push (desc);
}
+static int
+compare_paper_column_rank (Grob *const &a,
+ Grob *const &b)
+{
+ return Paper_column::get_rank (a) - Paper_column::get_rank (b);
+}
+
void
Simple_spacer_wrapper::add_columns (Link_array<Grob> const &icols)
{
scm_is_pair (s); s = scm_cdr (s))
{
Grob * other = unsmob_grob (scm_caar (s));
- int oi = cols.find_index (other);
+ int oi = binsearch_links (cols, other, &compare_paper_column_rank);
if (oi >= 0)
{
spacer_->add_rod (i, oi, scm_to_double (scm_cdar (s)));
}
}
+
+ if (i
+ && !to_boolean (cols[i]->get_property ("allow-outside-line")))
+ {
+ Interval e = cols[i]->extent (cols[i], X_AXIS);
+ spacer_->add_rod (i, cols.size()-1, e[RIGHT]);
+ spacer_->add_rod (0, i, e[LEFT]);
+ }
}
}
Pitch
Simultaneous_music::to_relative_octave (Pitch p)
{
+ Pitch retval = music_list_to_relative (music_list (), p, false);
if (lily_1_8_relative)
- lily_1_8_compatibility_used = true;
-
- return music_list_to_relative (music_list (), p, lily_1_8_relative);
+ {
+ Pitch retval_1_8 = music_list_to_relative (music_list (), p, true);
+ if (retval_1_8 != retval)
+ lily_1_8_compatibility_used = true;
+
+ retval = retval_1_8;
+ }
+
+ return retval;
}
ADD_MUSIC (Simultaneous_music);
% in a separate file to avoid tainting non-test font files for testing.
%
%
-
-
-fet_beginchar("espr", "espr", "espressivo")
+fet_beginchar("> accent", "sforzato", "sforzatoaccent")
set_char_box(.9 staff_space#, .9 staff_space#, .5 staff_space#, .5 staff_space#);
save thickness, diminish;
+
thickness = 0.05 staff_space + linethickness;
pickup pencircle scaled thickness;
- t = thickness;
- diminish = .75;
- top z1 =(0.2 staff_space,h);
- rt z3 =(w*2,0);
- bot y5 =-h;
- x5 = x1;
- x2 = .5[x1,x3];
- x4 = .5[x5,x3];
- z2 = whatever[z1,z3];
- z4 = whatever[z5,z3];
- penpos1(t,90);
- penpos2(t,90);
- penpos5(t,90);
- penpos4(t,90);
- penpos3(diminish*t,90);
- draw z1 .. z2;
- draw z5 .. z4;
- penstroke z4e .. z3e;
- penstroke z2e .. z3e;
- draw (z1 .. z2) xscaled -1;
- draw (z5 .. z4) xscaled -1;
- penstroke (z4e .. z3e) xscaled -1;
- penstroke (z2e .. z3e) xscaled -1;
- penlabels(1,2,3,4,5);
- pickup pencircle scaled (diminish* thickness);
- draw z3;
- draw z3 xscaled -1;
+ % prevent blobs at crossing lines
+ diminish = 1.0;
+
+ top y1 = h;
+ lft x1 = -b;
+ rt x2 = w;
+ y2 = .25 thickness* diminish;
+
+ rt z4 = (w,0);
+ x3 = - linethickness + 0.1 staff_space;
+ z3 = whatever [z1, z4];
+
+ penpos2(thickness*(2 - diminish)/2 , 90);
+ penpos1(thickness, 90);
+ penpos3(thickness, 90);
+
+ draw z1 .. z3;
+ draw (z1 .. z3) yscaled -1;
+ draw z4;
+ penstroke z3e .. z2e;
+ penstroke (z3e .. z2e) yscaled -1;
+
+ penlabels(1,2,3);
+ labels(4);
fet_endchar;
+fet_beginchar("espr", "espr", "espressivo")
+ set_char_box(1.9 staff_space#, 1.9 staff_space#, .5 staff_space#, .5 staff_space#);
+ save thickness, diminish;
+ thickness = 0.05 staff_space + linethickness;
+ pickup pencircle scaled thickness;
+ t = thickness;
+ diminish = .1;
+ top z1 =(0.2 staff_space,h);
+ rt z3 =(w,0);
+ x2 = .5[x1,x3];
+ z2 = whatever[z1,z3];
+ penpos1(t,90);
+ penpos2(t,90);
+ penpos3(diminish*t,90);
+ draw z1 .. z2;
+ penstroke z2e .. z3e;
+ penlabels(1,2,3);
+ pickup pencircle scaled (diminish* thickness);
+ draw z3;
+ addto currentpicture also currentpicture xscaled -1;
+ addto currentpicture also currentpicture yscaled -1;
+
+fet_endchar;
+
input feta-bolletjes;
%input feta-banier;
%input feta-slag;
def get_bbox (filename):
bbox = filename + '.bbox'
## -sOutputFile does not work with bbox?
- cmd = 'gs -sDEVICE=bbox -q -dNOPAUSE %s -c quit 2>%s' % \
+ cmd = 'gs -sDEVICE=bbox -q -dNOPAUSE %s -c showpage -c quit 2>%s' % \
(filename, bbox)
system (cmd, progress_p = 1)
box = open (bbox).read ()
header = open (ps_name).read (1024)
- match = re.match (BOUNDING_BOX_RE, header)
+ match = re.search (BOUNDING_BOX_RE, header, re.MULTILINE)
bbox = []
if match:
bbox = map (string.atoi, match.groups ())
if y == 0:
y = 1
- cmd = r'''gs -g%dx%d -sDEVICE=pnggray -dTextAlphaBits=4 -dGraphicsAlphaBits=4 -q -sOutputFile=%s -r%d -dNOPAUSE %s %s -c quit ''' % \
+ cmd = r'''gs -g%dx%d -sDEVICE=pnggray -dTextAlphaBits=4 -dGraphicsAlphaBits=4 -q -sOutputFile=%s -r%d -dNOPAUSE %s %s -c showpage -c quit ''' % \
(x, y, output_file, resolution, trans_ps, ps_name)
rms = glob.glob (base + '-page*.png')
if os.path.isfile (rmfile):
os.unlink (rmfile)
- cmd = r'''gs -s -sDEVICE=pnggray -dTextAlphaBits=4 -dGraphicsAlphaBits=4 -q -sOutputFile=%s -dNOPAUSE -r%d %s -c quit''' % (output_file,
+ cmd = r'''gs -s -sDEVICE=pnggray -dTextAlphaBits=4 -dGraphicsAlphaBits=4 -q -sOutputFile=%s -dNOPAUSE -r%d %s -c showpage -c quit''' % (output_file,
resolution, ps_name)
status = system (cmd)
(rehearsalMark ,integer? "The last rehearsal mark printed.")
(repeatCommands ,list? "This property is read to find any command of the form @code{(volta . @var{x})}, where @var{x} is a string or @code{#f}")
(restNumberThreshold ,number?
- "If a multimeasure rest takes less
-than this number of measures, no number is printed. ")
+ "If a multimeasure rest has more measures
+than this, a number is printed. ")
(shapeNoteStyles ,vector? "Vector of symbols, listing style for each note
head relative to the tonic (qv.) of the scale.")
(skipBars ,boolean? "If set to true, then
unset, script and slur ignore each other ")
(inspect-quants ,number-pair? "If debugging is set,
set beam quant to this position, and print the respective scores.")
-
+
+ (allow-outside-line ,boolean? "If set, allow this column to
+things sticking into the margin.")
(kern ,ly:dimension? "Amount of extra white space to add. For
bar line, this is the amount of space after a thick line.")
(knee ,boolean? "Is this beam kneed?")
(apply define-internal-grob-property x))
`(
-
+ (axis-group-parent-X ,ly:grob? "Containing X axis group")
+ (axis-group-parent-Y ,ly:grob? "Containing Y axis group")
(accidental-grobs ,list? "Alist with (NOTENAME . GROBLIST) entries")
(adjacent-hairpins ,grob-list? "List of directly neighboring hairpins")
(after-line-breaking-callback ,procedure? "This procedure is called after line breaking. Its return value is ignored.")