LEFT | RIGHT |
1 ;;;; This file is part of LilyPond, the GNU music typesetter. | 1 ;;;; This file is part of LilyPond, the GNU music typesetter. |
2 ;;;; | 2 ;;;; |
3 ;;;; Copyright (C) 2003--2011 Han-Wen Nienhuys <hanwen@xs4all.nl> | 3 ;;;; Copyright (C) 2003--2011 Han-Wen Nienhuys <hanwen@xs4all.nl> |
4 ;;;; | 4 ;;;; |
5 ;;;; LilyPond is free software: you can redistribute it and/or modify | 5 ;;;; LilyPond is free software: you can redistribute it and/or modify |
6 ;;;; it under the terms of the GNU General Public License as published by | 6 ;;;; it under the terms of the GNU General Public License as published by |
7 ;;;; the Free Software Foundation, either version 3 of the License, or | 7 ;;;; the Free Software Foundation, either version 3 of the License, or |
8 ;;;; (at your option) any later version. | 8 ;;;; (at your option) any later version. |
9 ;;;; | 9 ;;;; |
10 ;;;; LilyPond is distributed in the hope that it will be useful, | 10 ;;;; LilyPond is distributed in the hope that it will be useful, |
(...skipping 53 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
64 | 64 |
65 (define-public (stack-stencil-line space stencils) | 65 (define-public (stack-stencil-line space stencils) |
66 "DOCME" | 66 "DOCME" |
67 (if (and (pair? stencils) | 67 (if (and (pair? stencils) |
68 (ly:stencil? (car stencils))) | 68 (ly:stencil? (car stencils))) |
69 | 69 |
70 (if (and (pair? (cdr stencils)) | 70 (if (and (pair? (cdr stencils)) |
71 (ly:stencil? (cadr stencils))) | 71 (ly:stencil? (cadr stencils))) |
72 (let* ((tail (stack-stencil-line space (cdr stencils))) | 72 (let* ((tail (stack-stencil-line space (cdr stencils))) |
73 (head (car stencils)) | 73 (head (car stencils)) |
74 (xoff (+ space (cdr (ly:stencil-extent head X))))) | 74 (xoff (+ space (interval-length (ly:stencil-extent head X))))) |
75 (ly:stencil-add head | 75 (ly:stencil-add head |
76 (ly:stencil-translate-axis tail xoff X))) | 76 (ly:stencil-translate-axis tail xoff X))) |
77 (car stencils)) | 77 (car stencils)) |
78 (ly:make-stencil '() '(0 . 0) '(0 . 0)))) | 78 (ly:make-stencil '() '(0 . 0) '(0 . 0)))) |
79 | 79 |
80 | 80 |
81 ;;; convert a full markup object to an approximate pure string representation | 81 ;;; convert a full markup object to an approximate pure string representation |
82 | 82 |
83 (define-public (markup->string m) | 83 (define-public (markup->string m) |
84 ;; markup commands with one markup argument, formatting ignored | 84 ;; markup commands with one markup argument, formatting ignored |
(...skipping 45 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
130 (markup->string (cddr m))) | 130 (markup->string (cddr m))) |
131 | 131 |
132 ;; ignore all other markup functions | 132 ;; ignore all other markup functions |
133 ((markup-function? (car m)) "") | 133 ((markup-function? (car m)) "") |
134 | 134 |
135 ;; handle markup lists | 135 ;; handle markup lists |
136 ((list? m) | 136 ((list? m) |
137 (string-join (map markup->string m) " ")) | 137 (string-join (map markup->string m) " ")) |
138 | 138 |
139 (else "ERROR, unable to extract string from markup"))) | 139 (else "ERROR, unable to extract string from markup"))) |
LEFT | RIGHT |