CVSROOT: /cvsroot/lilypond
Module name: lilypond
Branch:
Changes by: Han-Wen Nienhuys <[EMAIL PROTECTED]> 05/04/18 12:29:24
Modified files:
. : ChangeLog
lily : line-interface.cc line-spanner.cc paper-book.cc
text-spanner.cc
lily/include : paper-book.hh
Log message:
* lily/text-spanner.cc: add bound-padding.
* lily/paper-book.cc (systems): accept Paper_score
iso. Paper_system vector.
* lily/line-interface.cc (make_arrow): new function. Patch by
Jonatan Liljedahl <http://kymatica.com>
(arrows): idem.
* lily/line-spanner.cc (line_stencil): add arrows.
CVSWeb URLs:
http://savannah.gnu.org/cgi-bin/viewcvs/lilypond/lilypond/ChangeLog.diff?tr1=1.3456&tr2=1.3457&r1=text&r2=text
http://savannah.gnu.org/cgi-bin/viewcvs/lilypond/lilypond/lily/line-interface.cc.diff?tr1=1.20&tr2=1.21&r1=text&r2=text
http://savannah.gnu.org/cgi-bin/viewcvs/lilypond/lilypond/lily/line-spanner.cc.diff?tr1=1.60&tr2=1.61&r1=text&r2=text
http://savannah.gnu.org/cgi-bin/viewcvs/lilypond/lilypond/lily/paper-book.cc.diff?tr1=1.104&tr2=1.105&r1=text&r2=text
http://savannah.gnu.org/cgi-bin/viewcvs/lilypond/lilypond/lily/text-spanner.cc.diff?tr1=1.112&tr2=1.113&r1=text&r2=text
http://savannah.gnu.org/cgi-bin/viewcvs/lilypond/lilypond/lily/include/paper-book.hh.diff?tr1=1.31&tr2=1.32&r1=text&r2=text
Patches:
Index: lilypond/ChangeLog
diff -u lilypond/ChangeLog:1.3456 lilypond/ChangeLog:1.3457
--- lilypond/ChangeLog:1.3456 Mon Apr 18 12:13:33 2005
+++ lilypond/ChangeLog Mon Apr 18 12:29:24 2005
@@ -1,5 +1,7 @@
2005-04-18 Han-Wen Nienhuys <[EMAIL PROTECTED]>
+ * lily/text-spanner.cc: add bound-padding.
+
* lily/paper-book.cc (systems): accept Paper_score
iso. Paper_system vector.
@@ -12,7 +14,6 @@
(arrows): idem.
* lily/line-spanner.cc (line_stencil): add arrows.
-
2005-04-18 Mathieu Giraud <[EMAIL PROTECTED]>
Index: lilypond/lily/include/paper-book.hh
diff -u lilypond/lily/include/paper-book.hh:1.31
lilypond/lily/include/paper-book.hh:1.32
--- lilypond/lily/include/paper-book.hh:1.31 Thu Mar 10 14:36:12 2005
+++ lilypond/lily/include/paper-book.hh Mon Apr 18 12:29:24 2005
@@ -26,6 +26,7 @@
SCM systems_;
SCM pages_;
+ void add_score_title (SCM);
public:
SCM header_;
SCM header_0_;
Index: lilypond/lily/line-interface.cc
diff -u lilypond/lily/line-interface.cc:1.20
lilypond/lily/line-interface.cc:1.21
--- lilypond/lily/line-interface.cc:1.20 Mon Apr 18 12:06:36 2005
+++ lilypond/lily/line-interface.cc Mon Apr 18 12:29:24 2005
@@ -13,26 +13,22 @@
#include "output-def.hh"
Stencil
-Line_interface::make_arrow (Offset beg, Offset end,
+Line_interface::make_arrow (Offset begin, Offset end,
Real thick,
Real length, Real width)
{
- Real angle = (end - beg).arg();
+ Real angle = (end - begin).arg();
Array<Offset> points;
//construct the arrow
points.push (Offset (0, 0));
- points.push (Offset (length, width));
- points.push (Offset (length, -width));
+ points.push (Offset (-length, width));
+ points.push (Offset (-length, -width));
// rotate and translate the arrow
for (int i = 0; i < points.size(); i++)
- points[i] = points[i] * complex_exp (Offset (0, angle)) + beg;
+ points[i] = points[i] * complex_exp (Offset (0, angle)) + end;
- // we must shorten the line half of arrow length
- // to prevent the line from sticking out
- beg = beg + Offset (length/2,0) * complex_exp (Offset (0, angle));
-
return (Lookup::round_filled_polygon (points, thick));
}
Index: lilypond/lily/line-spanner.cc
diff -u lilypond/lily/line-spanner.cc:1.60 lilypond/lily/line-spanner.cc:1.61
--- lilypond/lily/line-spanner.cc:1.60 Mon Apr 18 12:06:36 2005
+++ lilypond/lily/line-spanner.cc Mon Apr 18 12:29:24 2005
@@ -144,7 +144,7 @@
if (to_boolean (me->get_property ("arrow")))
line.add_stencil (Line_interface::arrows (me, from, to, false, true));
- return Stencil ();
+ return line;
}
/*
@@ -188,7 +188,7 @@
Real gap = robust_scm2double (me->get_property ("gap"), 0.0);
- Offset ofxy (gap, 0); /*offset from start point to start of line*/
+ Offset ofxy (gap, 0); /* offset from start point to start of line */
Offset dxy;
Offset my_off;
Offset his_off;
Index: lilypond/lily/paper-book.cc
diff -u lilypond/lily/paper-book.cc:1.104 lilypond/lily/paper-book.cc:1.105
--- lilypond/lily/paper-book.cc:1.104 Mon Apr 18 12:10:37 2005
+++ lilypond/lily/paper-book.cc Mon Apr 18 12:29:24 2005
@@ -219,6 +219,21 @@
}
}
+void
+Paper_book::add_score_title (SCM header)
+{
+ Stencil title = score_title (header);
+ if (title.is_empty ())
+ title = score_title (header_);
+ if (!title.is_empty ())
+ {
+ Paper_system *ps = new Paper_system (title, true);
+ systems_ = scm_cons (ps->self_scm (), systems_);
+ scm_gc_unprotect_object (ps->self_scm ());
+ set_system_penalty (ps, header);
+ }
+}
+
SCM
Paper_book::systems ()
{
@@ -253,17 +268,8 @@
else if (Paper_score *pscore
= dynamic_cast<Paper_score *> (unsmob_music_output (scm_car
(s))))
{
+ add_score_title (header);
- Stencil title = score_title (header);
- if (title.is_empty ())
- title = score_title (header_);
- if (!title.is_empty ())
- {
- Paper_system *ps = new Paper_system (title, true);
- systems_ = scm_cons (ps->self_scm (), systems_);
- scm_gc_unprotect_object (ps->self_scm ());
- set_system_penalty (ps, header);
- }
header = SCM_EOL;
@@ -271,6 +277,18 @@
system_list = scm_reverse (system_list);
systems_ = scm_append (scm_list_2 (system_list, systems_));
}
+ else if (scm_is_vector (scm_car (s)))
+ {
+ /*
+ UGH. code dup.
+ */
+ add_score_title (header);
+ header = SCM_EOL;
+
+ SCM system_list = scm_vector_to_list (scm_car (s));
+ system_list = scm_reverse (system_list);
+ systems_ = scm_append (scm_list_2 (system_list, systems_));
+ }
else if (Text_interface::markup_p (scm_car (s)))
{
SCM t = Text_interface::interpret_markup (paper_->self_scm (),
Index: lilypond/lily/text-spanner.cc
diff -u lilypond/lily/text-spanner.cc:1.112 lilypond/lily/text-spanner.cc:1.113
--- lilypond/lily/text-spanner.cc:1.112 Mon Apr 18 12:06:36 2005
+++ lilypond/lily/text-spanner.cc Mon Apr 18 12:29:24 2005
@@ -129,9 +129,10 @@
Interval ext = edge[d].extent (X_AXIS);
if (!ext.is_empty ())
{
+ Real pad = robust_scm2double (me->get_property ("bound-padding"),
0.0);
edge[d].translate_axis (span_points[d], X_AXIS);
m.add_stencil (edge[d]);
- span_points[d] += -d * ext[-d];
+ span_points[d] += -d * (ext[-d] + pad);
}
}
while (flip (&d) != LEFT);
@@ -159,5 +160,5 @@
ADD_INTERFACE (Text_spanner, "text-spanner-interface",
"generic text spanner",
- "dash-period dash-fraction edge-height bracket-flare edge-text
shorten-pair style thickness enclose-bounds");
+ "bound-padding dash-period dash-fraction edge-height
bracket-flare edge-text shorten-pair style thickness enclose-bounds");
_______________________________________________
Lilypond-cvs mailing list
[email protected]
http://lists.gnu.org/mailman/listinfo/lilypond-cvs