]> git.donarmstrong.com Git - lilypond.git/blobdiff - scm/output-lib.scm
Clean up the Align_interface API.
[lilypond.git] / scm / output-lib.scm
index 5684e1e1accc05158d5a03343805836ec667732a..716f36a735071a4061787646bbfb743fd51e6041 100644 (file)
@@ -173,6 +173,55 @@ and duration-log @var{log}."
           letter)))
      radius X)))
 
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;; clipping
+
+(define-public (make-rhythmic-location bar-num num den)
+  (cons
+   bar-num (ly:make-moment num den)))
+
+(define-public (rhythmic-location? a)
+  (and (pair? a)
+       (integer? (car a))
+       (ly:moment? (cdr a))))
+
+(define-public (make-graceless-rhythmic-location loc)
+  (make-rhythmic-location
+   (car loc)
+   (ly:moment-main-numerator (rhythmic-location-measure-position loc))
+   (ly:moment-main-denominator (rhythmic-location-measure-position loc))))
+
+(define-public rhythmic-location-measure-position cdr)
+(define-public rhythmic-location-bar-number car)
+
+(define-public (rhythmic-location<? a b)
+  (cond
+   ((< (car a) (car b)) #t)
+   ((> (car a) (car b)) #f)
+   (else
+    (ly:moment<? (cdr a) (cdr b)))))
+
+(define-public (rhythmic-location<=? a b)
+  (not (rhythmic-location<? b a)))
+(define-public (rhythmic-location>=? a b)
+  (rhythmic-location<? a b))
+(define-public (rhythmic-location>? a b)
+  (rhythmic-location<? b a))
+
+(define-public (rhythmic-location=? a b)
+  (and (rhythmic-location<=? a b)
+       (rhythmic-location<=? b a)))
+
+(define-public (rhythmic-location->file-string a)
+  (ly:format "~a.~a.~a"
+            (car a)
+            (ly:moment-main-numerator (cdr a))
+            (ly:moment-main-denominator (cdr a))))
+
+(define-public (rhythmic-location->string a)
+  (ly:format "bar ~a ~a"
+            (car a)
+            (ly:moment->string (cdr a))))
 
 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
 ;; break visibility
@@ -891,23 +940,3 @@ between the two text elements."
 (define-public (laissez-vibrer::print grob)
  (ly:tie::print grob))
 
-(define-public (define-fonts paper define-font)
-  "Return a string of all fonts used in PAPER, invoking the function
-DEFINE-FONT for procuding the actual font definition."
-
-  (define font-list (ly:paper-fonts paper))
-
-  (define (font-load-command font)
-    (let* ((font-name (ly:font-name font))
-          (designsize (ly:font-design-size font))
-          (magnification (* (ly:font-magnification font)))
-          (ops (ly:output-def-lookup paper 'output-scale))
-          (scaling (* ops magnification designsize)))
-      (if (equal? font-name "unknown")
-         (display (list font font-name)))
-      (define-font font font-name scaling)))
-
-  (apply string-append
-        (map (lambda (x) (font-load-command x))
-             (filter (lambda (x) (not (ly:pango-font? x)))
-                     font-list))))