Merge branch 'release/2.11.59-1'
[lilypond.git] / input / manual / font-table.ly
blob476e36af378927e9938cb7889cb41d52eb8e723d
1 #(set-global-staff-size 16)
3 \paper {
4 %% ugh. text on toplevel is a bit broken...
6 oddHeaderMarkup = \markup {}
7 evenHeaderMarkup = \markup {}
8 oddFooterMarkup = \markup {}
9 evenFooterMarkup = \markup {}
12 \version "2.11.57"
14 #(define-markup-command (doc-char layout props name) (string?)
15 (interpret-markup layout props
16 (let* ((n (string-length name)))
17 (if (> n 24)
18 ;; split long glyph names near the middle at dots
19 (let* ((middle-pos (round (/ n 2)))
20 (left-dot-pos (string-rindex name #\. 0 middle-pos))
21 (right-dot-pos (string-index name #\. middle-pos))
22 (left-distance (if (number? left-dot-pos)
23 (- middle-pos left-dot-pos)
24 middle-pos))
25 (right-distance (if (number? right-dot-pos)
26 (- right-dot-pos middle-pos)
27 middle-pos))
28 (split-pos (if (> left-distance right-distance)
29 right-dot-pos
30 left-dot-pos))
31 (left (substring name 0 split-pos))
32 (right (substring name split-pos)))
33 (markup
34 #:pad-to-box '(0 . 36) '(-2 . 2) #:column (#:typewriter left
35 #:typewriter #:concat (" " right))
36 #:pad-to-box '(-2 . 4) '(-3.5 . 3.5) #:huge #:musicglyph name))
37 (markup
38 #:pad-to-box '(0 . 36) '(-2 . 2) #:typewriter name
39 #:pad-to-box '(-2 . 4) '(-3.5 . 3.5) #:huge #:musicglyph name)))))
41 #(define-markup-list-command (doc-chars layout props names) (list?)
42 (define (min-length lst n)
43 "(min (length lst) n)"
44 (if (or (null? lst) (<= n 0))
46 (1+ (min-length (cdr lst) (1- n)))))
47 (define (doc-chars-aux names acc)
48 (let* ((n (min-length names 2))
49 (head (take names n))
50 (tail (drop names n)))
51 (if (null? head)
52 (reverse! acc)
53 (doc-chars-aux tail
54 (cons (make-line-markup (map make-doc-char-markup head))
55 acc)))))
56 (interpret-markup-list layout props (doc-chars-aux names (list))))
58 \markuplines \override-lines #'(word-space . 4)
59 \doc-chars #(delete ".notdef"
60 (ly:otf-glyph-list (ly:font-load "emmentaler-20")))