+2002-06-21 Jan Nieuwenhuizen <janneke@gnu.org>
+
+ * input/test/script-priority.ly: New file.
+
2002-06-20 Han-Wen <hanwen@cs.uu.nl>
* lily/system.cc (output_lines): kill grobs that are only for spacing.
2002-06-20 Jan Nieuwenhuizen <janneke@gnu.org>
+ * lily/fingering-engraver.cc (make_script):
+ * lily/script-engraver.cc (process_music):
+ * lily/text-engraver.cc:
+ (process_acknowledged_grobs): Remove hard coded script-priority.
+
+ * flower/warn.cc: Cleanup.
+
+ * lily/voice-devnull-engraver.cc: Also eat multi-measure rest, a
+ spanner now.
+
* aclocal.m4: Regenerate.
* stepmake/aclocal.m4: Also set GUILE_PATCH_LEVEL.
+/*
+ warn.cc -- implement warnings
+
+ source file of the Flower Library
+
+ (c) 1997--2000 Han-Wen Nienhuys <hanwen@cs.uu.nl>
+*/
+
#include <stdlib.h>
#include <stdio.h>
void
-error (String s)
+message (String s)
{
- fputs ( _f("error: %s\n", s.ch_C()).ch_C(), stderr);
- exit (1);
+ fputs (s.ch_C (), stderr);
}
void
-non_fatal_error (String s)
+warning (String s)
{
- fputs ( _f("error: %s\n", s.ch_C()).ch_C(), stderr);
+ message (_f ("warning: %s\n", s.ch_C ()));
}
void
-warning (String m)
+non_fatal_error (String s)
{
- fputs ( _f("warning: %s\n", m.ch_C()).ch_C(), stderr);
+ message (_f ("error: %s\n", s.ch_C ()));
}
void
-message (String m)
+error (String s)
{
- fprintf (stderr, "%s\n",m.ch_C());
+ non_fatal_error (s);
+ exit (1);
}
void
programming_error (String s)
{
- fputs ( _f("programming error: %s (Continuing; cross thumbs)\n", s.ch_C()).ch_C(), stderr);
+ message (_f ("programming error: %s (Continuing; cross thumbs)\n",
+ s.ch_C ()));
}
--- /dev/null
+\header {
+ texidoc = "Relative placements of different script types can be controlled
+by overriding script-priority."
+}
+\paper { linewidth = -1. }
+\score{
+ \context Staff \notes \relative g''{
+
+ \property Score.TextScript \override #'script-priority = #-100
+ a4^\prall^#'((music (font-relative-size . -2)) "accidentals-1")
+
+
+ \property Score.Script \override #'script-priority = #-100
+ \property Score.TextScript \revert #'script-priority
+
+ a4^\prall^#'((music (font-relative-size . -2)) "accidentals-1")
+ }
+}
fingering->add_offset_callback (Self_alignment_interface::aligned_on_self_proc, other);
fingering->add_offset_callback (Self_alignment_interface::centered_on_parent_proc, other);
- fingering->set_grob_property ("script-priority",
- gh_int2scm (100 + d* i));
+
+ // Hmm
+ int priority = 200;
+ SCM s = fingering->get_grob_property ("script-priority");
+ if (gh_number_p (s))
+ priority = gh_scm2int (s);
+
+ /* Make sure they're in order of user input by adding index i. */
+ priority += d*i;
+
+ fingering->set_grob_property ("script-priority", gh_int2scm (priority));
if (!ly_dir_p (fingering->get_grob_property ("direction")))
force_dir = ly_car (art);
art = ly_cdr (art);
- SCM priority = ly_car (art);
+ int priority = gh_scm2int (ly_car (art));
+
+ SCM s = p->get_grob_property ("script-priority");
+ if (gh_number_p (s))
+ priority = gh_scm2int (s);
+
+ /* Make sure they're in order of user input by adding index i. */
+ priority += i * (to_dir (force_dir) ? to_dir (force_dir) : 1);
if (ly_dir_p (force_dir) && to_dir (force_dir))
p->set_grob_property ("direction", force_dir);
p->add_offset_callback (Side_position_interface::quantised_position_proc, Y_AXIS);
- p->set_grob_property ("script-priority", priority);
+ p->set_grob_property ("script-priority", gh_int2scm (priority));
script_p_arr_.push (p);
Axis ax = to_boolean (axisprop) ? X_AXIS : Y_AXIS;
Side_position_interface::set_axis (text, ax);
- /*
- make sure they're in order by adding i to the priority field.
- */
- text->set_grob_property ("script-priority",
- gh_int2scm (200 + i));
+ // Hmm
+ int priority = 200;
+ SCM s = text->get_grob_property ("script-priority");
+ if (gh_number_p (s))
+ priority = gh_scm2int (s);
+
+ /* Make sure they're in order of user input by adding index i. */
+ priority += i * (r->get_direction () ? r->get_direction () : 1);
+
+ text->set_grob_property ("script-priority", gh_int2scm (priority));
if (r->get_direction ())
Side_position_interface::set_direction (text, r->get_direction ());
"beam",
"crescendo",
"decrescendo",
+ "rest",
"slur",
0
};
(X-offset-callbacks . (,Self_alignment_interface::centered_on_parent
,Self_alignment_interface::aligned_on_self))
(padding . 0.6)
- ; (direction . -1)
+ ;; (direction . -1)
(self-alignment-X . 0)
(self-alignment-Y . 0)
+ (script-priority . 100)
(font-family . number)
(font-relative-size . -3)
(font-shape . upright)
;; This value is sensitive: if too large, staccato dots will move a
;; space a away.
- (padding . 0.25)
+ (padding . 0.25)
+ ;; (script-priority . 0) priorities for scripts, see script.scm
(X-offset-callbacks . (,Self_alignment_interface::centered_on_parent))
(before-line-breaking-callback . ,Script_interface::before_line_breaking)
(font-family . music)
(no-spacing-rods . #t)
(direction . -1)
(padding . 0.5)
+ (script-priority . 200)
;; todo: add X self alignment?
(baseline-skip . 2)
(font-family . roman)