X-Git-Url: https://git.donarmstrong.com/?a=blobdiff_plain;f=scm%2Flily-library.scm;h=480e1672ad8c0bd1e34622c288513ced7bcb03ed;hb=49465d11fb5e62a976e41768f142ef0fb58c08c3;hp=3d3e19c148fbe18cc0e211fca4fcdbdfe15148c6;hpb=1a30621b7f53bab51449dac495bb0ec90cd0aab2;p=lilypond.git diff --git a/scm/lily-library.scm b/scm/lily-library.scm index 3d3e19c148..480e1672ad 100644 --- a/scm/lily-library.scm +++ b/scm/lily-library.scm @@ -123,9 +123,17 @@ found." )) ;;;;;;;;;;;;;;;; -;; hash - +;; vector +(define-public (vector-for-each proc vec) + (do + ((i 0 (1+ i))) + ((>= i (vector-length vec)) vec) + + (vector-set! vec i + (proc (vector-ref vec i))))) +;;;;;;;;;;;;;;;; +;; hash (if (not (defined? 'hash-table?)) ; guile 1.6 compat (begin @@ -324,3 +332,13 @@ possibly turned off." ((equal? (ly:unit) "pt") (/ 72.0 72.27)) (else (error "unknown unit" (ly:unit))))) +;;; font +(define-public (font-family font) + (let ((name (ly:font-name font))) + (if name + (regexp-substitute/global #f "^GNU-(.*)-[.0-9]*$" name 'pre 1 'post) + (begin + ;;(stderr "font-name: ~S\n" (ly:font-name font)) + ;;(stderr "font-file-name: ~S\n" (ly:font-file-name font)) + (ly:font-file-name font))))) +