]> git.donarmstrong.com Git - lilypond.git/commitdiff
(write-system-signature): escape newlines too.
authorHan-Wen Nienhuys <hanwen@xs4all.nl>
Thu, 1 Jun 2006 10:52:55 +0000 (10:52 +0000)
committerHan-Wen Nienhuys <hanwen@xs4all.nl>
Thu, 1 Jun 2006 10:52:55 +0000 (10:52 +0000)
ChangeLog
buildscripts/output-distance.py
scm/stencil.scm

index 8024617f844055317e7262d19bbfec69bf83791f..43c9767677095f40ad20f89d5aa7a883fe23c387 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,7 @@
+2006-06-01  Han-Wen Nienhuys  <hanwen@lilypond.org>
+
+       * scm/stencil.scm (write-system-signature): escape newlines too.
+
 2006-01-01  Graham Percival  <gpermus@gmail.com>
 
        * Documentation/user/music-glossary.tely: Spanish updates
index 1e25c1813a54ce17f0514036e4cd909ee2967a95..927d553bc43a30f8608962cde3ec0951205268ba 100644 (file)
@@ -28,6 +28,9 @@ def max_distance (x1, x2):
 empty_interval = (INFTY, -INFTY)
 empty_bbox = (empty_interval, empty_interval)
 
+def interval_is_empty (i):
+    return i[0] > i[1]
+
 def interval_length (i):
     return max (i[1]-i[0], 0) 
     
@@ -39,6 +42,10 @@ def interval_intersect (i1, i2):
     return (max (i1[0], i2[0]),
             min (i1[1], i2[1]))
 
+def bbox_is_empty (b):
+    return (interval_is_empty (b[0])
+            or interval_is_empty (b[1]))
+
 def bbox_union (b1, b2):
     return (interval_union (b1[X_AXIS], b2[X_AXIS]),
             interval_union (b2[Y_AXIS], b2[Y_AXIS]))
@@ -143,6 +150,11 @@ class SystemLink:
         self.back_link_dict = {}
 
         for g in system1.grobs ():
+
+            ## skip empty bboxes.
+            if bbox_is_empty (g.bbox):
+                continue
+            
             closest = system2.closest (g.name, g.centroid)
             
             self.link_list_dict.setdefault (closest, [])
@@ -399,10 +411,14 @@ def test_basic_compare ():
     p (scorify-music m p)))))
 
 %(papermod)s
-
-\relative c {
+<<
+\new Staff \relative c {
+  c^"%(userstring)s" %(extragrob)s
+  }
+\new Staff \relative c {
   c^"%(userstring)s" %(extragrob)s
   }
+>>
 """
 
     dicts = [{ 'papermod' : '',
index 01694195714c8e3cbfbb3ac5c33f155b5c247971..150c1d88135b66e756bc43f629e45c5a2ede0125 100644 (file)
@@ -324,7 +324,7 @@ grestore
 
   (define (pythonic-string expr)
     "escape quotes and slashes for python consumption"
-    (regexp-substitute/global #f "([\\\\'\"])" (format "~a" expr) 'pre "\\" 1 'post))
+    (regexp-substitute/global #f "([\n\\\\'\"])" (format "~a" expr) 'pre "\\" 1 'post))
 
   (define (pythonic-pair expr)
     (format "(~a,~a)"