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)$"))
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\\."))
80 ;; remove all remaining groups from the glyph-list
82 (lambda
(x
) (set
! glyph-list
(delete x glyph-list
)))
102 ;; require all glyphs to appear here
103 (if
(pair? glyph-list
) ; glyph-list should be empty by now
105 (_ "Unlisted glyphs in Documentation/included/font-table.ly: ~A")
108 ) % end of (begin ...)
111 %% ugh. text on toplevel is a bit broken...
113 oddHeaderMarkup
= \markup {}
114 evenHeaderMarkup
= \markup {}
115 oddFooterMarkup
= \markup {}
116 evenFooterMarkup
= \markup {}
121 #(define-markup-command
(doc-char layout props name
) (string?
)
122 (interpret-markup layout props
123 (let
* ((n
(string-length name
)))
125 ;; split long glyph names near the middle at dots
126 (let
* ((middle-pos
(round
(/ n
2)))
127 (left-dot-pos
(string-rindex name
#\
. 0 middle-pos
))
128 (right-dot-pos
(string-index name
#\
. middle-pos
))
129 (left-distance
(if
(number? left-dot-pos
)
130 (- middle-pos left-dot-pos
)
132 (right-distance
(if
(number? right-dot-pos
)
133 (- right-dot-pos middle-pos
)
135 (split-pos
(if
(> left-distance right-distance
)
138 (left
(substring name
0 split-pos
))
139 (right
(substring name split-pos
)))
141 #:pad-to-box
'(0 . 36) '(-
2 . 2) #:column
(#:typewriter left
142 #:typewriter
#:concat
(" " right
))
143 #:pad-to-box
'(-
2 . 4) '(-
3.5 . 3.5) #:huge
#:musicglyph name
))
145 #:pad-to-box
'(0 . 36) '(-
2 . 2) #:typewriter name
146 #:pad-to-box
'(-
2 . 4) '(-
3.5 . 3.5) #:huge
#:musicglyph name
)))))
148 #(define-markup-list-command
(doc-chars layout props names
) (list?
)
149 (define
(min-length lst n
)
150 "(min (length lst) n)"
151 (if
(or
(null? lst
) (<= n
0))
153 (1+
(min-length
(cdr lst
) (1- n
)))))
154 (define
(doc-chars-aux names acc
)
155 (let
* ((n
(min-length names
2))
156 (head
(take names n
))
157 (tail
(drop names n
)))
161 (cons
(make-line-markup
(map make-doc-char-markup head
))
163 (interpret-markup-list layout props
(doc-chars-aux names
(list
))))