1 #(set-global-staff-size 16)
5 ;; some helper functions
7 (use-modules (ice-9 regex))
11 (ly:otf-glyph-list (ly:system-font-load "emmentaler-20"))))
13 (define (get-group glyph-list regexp)
14 (let ((r (make-regexp regexp)))
15 (filter (lambda (token) (regexp-exec r token))
20 ;; extract ancient-music groups before extracting default
21 ;; accidentals, rests, etc. to prevent duplication
23 ;; make sure "mensural" regexp doesn't match "neomensural"
24 (define neomensural (get-group glyph-list "^.*neomensural.*$"))
26 (filter (lambda (x) (not (member x neomensural)))
27 (get-group glyph-list "^.*mensural.*$")))
29 ;; get the rest of the ancient-music groups
30 (define vaticana (get-group glyph-list "^.*vaticana.*$"))
31 (define medicaea (get-group glyph-list "^.*medicaea.*$"))
32 (define hufnagel (get-group glyph-list "^.*hufnagel.*$"))
33 (define petrucci (get-group glyph-list "^.*petrucci.*$"))
34 (define solesmes (get-group glyph-list "^.*solesmes.*$"))
36 ;; remove ancient-music groups from the glyph-list
38 (lambda (x) (set! glyph-list (delete x glyph-list)))
47 ;; define all remaining groups
49 '("plus" "comma" "hyphen" "period"
50 "zero" "one" "two" "three" "four"
51 "five" "six" "seven" "eight" "nine"))
54 '("space" "f" "m" "p" "r" "s" "z"))
56 (define default-noteheads
58 "^noteheads.[dsu]M?[012]$"))
60 (define special-noteheads
62 "^noteheads.[dsu]M?[012](double|harmonic|diamond|cross|xcircle|triangle|slash)$"))
64 (define shape-note-noteheads
66 "^noteheads.[dsu][012](do|re|mi|fa|sol|la|ti)(Thin|Mirror|Funk|Walker)*$"))
68 (define clefs (get-group glyph-list "^clefs\\."))
69 (define timesig (get-group glyph-list "^timesig\\."))
70 (define accidentals (get-group glyph-list "^accidentals\\."))
71 (define rests (get-group glyph-list "^rests\\."))
72 (define flags (get-group glyph-list "^flags\\."))
73 (define dots (get-group glyph-list "^dots\\."))
74 (define scripts (get-group glyph-list "^scripts\\."))
75 (define arrowheads (get-group glyph-list "^arrowheads\\."))
76 (define brackettips (get-group glyph-list "^brackettips\\."))
77 (define pedal (get-group glyph-list "^pedal\\."))
78 (define accordion (get-group glyph-list "^accordion\\."))
79 (define ties (get-group glyph-list "^ties\\."))
81 ;; remove all remaining groups from the glyph-list
83 (lambda (x) (set! glyph-list (delete x glyph-list)))
104 ;; require all glyphs to appear here
105 (if (pair? glyph-list) ; glyph-list should be empty by now
107 (_ "Unlisted glyphs in Documentation/included/font-table.ly: ~A")
110 ) % end of (begin ...)
113 %% ugh. text on toplevel is a bit broken...
115 oddHeaderMarkup = \markup {}
116 evenHeaderMarkup = \markup {}
117 oddFooterMarkup = \markup {}
118 evenFooterMarkup = \markup {}
123 #(define-markup-command (doc-char layout props name) (string?)
124 (interpret-markup layout props
125 (let* ((n (string-length name)))
127 ;; split long glyph names near the middle at dots
128 (let* ((middle-pos (round (/ n 2)))
129 (left-dot-pos (string-rindex name #\. 0 middle-pos))
130 (right-dot-pos (string-index name #\. middle-pos))
131 (left-distance (if (number? left-dot-pos)
132 (- middle-pos left-dot-pos)
134 (right-distance (if (number? right-dot-pos)
135 (- right-dot-pos middle-pos)
137 (split-pos (if (> left-distance right-distance)
140 (left (substring name 0 split-pos))
141 (right (substring name split-pos)))
143 #:pad-to-box '(0 . 36) '(-2 . 2) #:column (#:typewriter left
144 #:typewriter #:concat (" " right))
145 #:pad-to-box '(-2 . 4) '(-3.5 . 3.5) #:huge #:musicglyph name))
147 #:pad-to-box '(0 . 36) '(-2 . 2) #:typewriter name
148 #:pad-to-box '(-2 . 4) '(-3.5 . 3.5) #:huge #:musicglyph name)))))
150 #(define-markup-list-command (doc-chars layout props names) (list?)
151 (define (min-length lst n)
152 "(min (length lst) n)"
153 (if (or (null? lst) (<= n 0))
155 (1+ (min-length (cdr lst) (1- n)))))
156 (define (doc-chars-aux names acc)
157 (let* ((n (min-length names 2))
158 (head (take names n))
159 (tail (drop names n)))
163 (cons (make-line-markup (map make-doc-char-markup head))
165 (interpret-markup-list layout props (doc-chars-aux names (list))))