From 9fc875b9848a49c370dd18051d242d6dbc761310 Mon Sep 17 00:00:00 2001 From: Han-Wen Nienhuys Date: Thu, 6 Apr 2006 00:23:02 +0000 Subject: [PATCH] * lily/slur.cc (print): only set font-size if not set yet. * lily/slur-configuration.cc (add_score): improved layout of debug scoring output. --- ChangeLog | 21 ++++++++++--- lily/slur-configuration.cc | 8 +++-- lily/slur-scoring.cc | 2 +- lily/slur.cc | 7 +++-- ly/declarations-init.ly | 1 - ps/music-drawing-routines.ps | 57 +++++++++++++++--------------------- 6 files changed, 53 insertions(+), 43 deletions(-) diff --git a/ChangeLog b/ChangeLog index 80f7fb76fc..8a7142b698 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,16 @@ +2006-04-06 Han-Wen Nienhuys + + * lily/slur.cc (print): only set font-size if not set yet. + + * lily/slur-configuration.cc (add_score): improved layout of debug + scoring output. + +2006-04-05 David Feuer + + * music-drawing-routines.ps (draw_round_box): removed testing artifact. + (draw_circle): Hopefully fixed regression. + Improved documentation for several procedures. + 2006-03-04 Werner Lemberg * ly/engraver-init.ly (\Score): Add beam-event to quotedEventTypes. @@ -5,7 +18,7 @@ 2006-04-05 Han-Wen Nienhuys * scripts/musicxml2ly.py (bindir): add dynamic - relocation. Backportme. + relocation. 2006-04-04 Graham Percival @@ -26,8 +39,8 @@ (*SF, stroke_and_fill): new procedures. Replaced stroke and fill with stroke_and_fill throughout. (euclidean_length, print_letter, draw_box): Deleted unused - procedures. If someone needs draw_box, implement it using - draw_round_box; don't duplicate code. + procedures. If someone needs draw_box, implement it using + draw_round_box; don't duplicate code. (print_glyphs, draw_round_box, draw_polygon, draw_repeat_slash): Refactored/cleaned up interfaces. (mark_URI): Moved. @@ -61,7 +74,7 @@ 2006-04-03 Han-Wen Nienhuys * scm/music-functions.scm (quote-substitute): set - iterators-ctor. Backportme. + iterators-ctor. 2006-03-31 Han-Wen Nienhuys diff --git a/lily/slur-configuration.cc b/lily/slur-configuration.cc index cd96fed4e3..3aabe8407d 100644 --- a/lily/slur-configuration.cc +++ b/lily/slur-configuration.cc @@ -182,7 +182,9 @@ Slur_configuration::add_score (Real s, string desc) if (s) { - score_card_ += to_string ("%s=%.2f ", desc.c_str (), s); + if (score_card_.length () > 0) + score_card_ += ", "; + score_card_ += to_string ("%s=%.2f", desc.c_str (), s); score_ += s; } } @@ -405,7 +407,9 @@ Slur_configuration::score_edges (Slur_score_state const &state) demerit *= exp (state.dir_ * d * slope * state.parameters_.edge_slope_exponent_); - add_score (demerit, "edge"); + + string dir_str = d == LEFT ? "L" : "R"; + add_score (demerit, dir_str + " edge"); } while (flip (&d) != LEFT); } diff --git a/lily/slur-scoring.cc b/lily/slur-scoring.cc index 77a5a22c0f..f4b312e5bd 100644 --- a/lily/slur-scoring.cc +++ b/lily/slur-scoring.cc @@ -383,7 +383,7 @@ Slur_score_state::get_best_curve () if (opt_idx >= 0) { total = configurations_[opt_idx]->card (); - total += to_string ("TOTAL=%.2f idx=%d", configurations_[opt_idx]->score (), opt_idx); + total += to_string (" TOTAL=%.2f idx=%d", configurations_[opt_idx]->score (), opt_idx); } else { diff --git a/lily/slur.cc b/lily/slur.cc index e482763a5b..16b63bef8d 100644 --- a/lily/slur.cc +++ b/lily/slur.cc @@ -115,8 +115,11 @@ Slur::print (SCM smob) string str; SCM properties = Font_interface::text_font_alist_chain (me); - properties = scm_cons (scm_acons (ly_symbol2scm ("font-size"), scm_from_int (-6), SCM_EOL), - properties); + + if (!scm_is_number (me->get_property ("font-size"))) + properties = scm_cons (scm_acons (ly_symbol2scm ("font-size"), scm_from_int (-6), SCM_EOL), + properties); + Stencil tm = *unsmob_stencil (Text_interface::interpret_markup (me->layout ()->self_scm (), properties, quant_score)); diff --git a/ly/declarations-init.ly b/ly/declarations-init.ly index 7dbc3b3c29..f60c9f4578 100644 --- a/ly/declarations-init.ly +++ b/ly/declarations-init.ly @@ -98,7 +98,6 @@ partCombineListener = \layout { } \context { \Score - ignoreQuotes = ##t skipTypesetting = ##t ignoreBarChecks = ##t } diff --git a/ps/music-drawing-routines.ps b/ps/music-drawing-routines.ps index 1ceab9a64b..35c3d23a55 100644 --- a/ps/music-drawing-routines.ps +++ b/ps/music-drawing-routines.ps @@ -128,29 +128,18 @@ bind def } bind def /draw_round_box % width height x y blot -currentdict /testing known -{{ - setlinewidth - 0 setlinecap - 1 setlinejoin - - rmoveto - currentpoint - 4 2 roll - rectstroke -}} -{{ - setlinewidth +{ + setlinewidth % w h x y 0 setlinecap 1 setlinejoin - rmoveto - currentpoint - 4 2 roll + rmoveto % w h + currentpoint % w h x1 y1 + 4 2 roll % x1 y1 w h 4 copy rectfill rectstroke -}} ifelse bind def +} bind def /draw_polygon % fill? x(n) y(n) x(n-1) y(n-1) ... x(0) y(0) n blot { @@ -174,7 +163,7 @@ currentdict /testing known } ifelse } bind def -/draw_repeat_slash % x-width width height +/draw_repeat_slash % x-width width height draw_repeat_slash { 2 index % duplicate x-width 1 setlinecap @@ -203,7 +192,7 @@ currentdict /testing known grestore } bind def -/draw_dot % radius x y +/draw_dot % radius x y draw_dot { rmoveto currentpoint @@ -211,11 +200,12 @@ currentdict /testing known 0 360 arc closepath stroke_and_fill } bind def -/draw_circle % F R T +/draw_circle % filled? radius thickness draw_circle { - setlinewidth + setlinewidth % f? r + currentpoint % f? r x0 y0 + 3 2 roll % f? x0 y0 r dup 0 rmoveto - currentpoint 3 2 roll 0 360 arc closepath { stroke_and_fill } { stroke } @@ -223,22 +213,22 @@ currentdict /testing known } bind def -/draw_line % dx dy x1 y1 thickness +/draw_line % dx dy x1 y1 thickness draw_line { - setlinewidth + setlinewidth % dx dy x1 y1 1 setlinecap 1 setlinejoin - rmoveto + rmoveto % dx dy rlineto stroke } bind def -/draw_dashed_line % dx dy thickness dashpattern +/draw_dashed_line % dx dy thickness dashpattern draw_dashed_line { 1 setlinecap 1 setlinejoin - setdash - setlinewidth + setdash % dx dy thickness + setlinewidth %dx dy rlineto stroke } bind def @@ -257,12 +247,13 @@ gsave grestore } bind def -/print_glyphs { +/print_glyphs % dx dy glyph print_glyphs +{ { - currentpoint - 3 2 roll - glyphshow - moveto + currentpoint %dx dy glyph x0 y0 + 3 2 roll %dx dy x0 y0 glyph + glyphshow % dx dy x0 y0 + moveto % dx dy rmoveto }repeat }bind def -- 2.39.2