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) 2008--2011 Reinhold Kainhofer <reinhold@kainhofer.com> | 3 ;;;; Copyright (C) 2008--2011 Reinhold Kainhofer <reinhold@kainhofer.com> |
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 106 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
117 "Old straight flag style (for composers like Bach). The angles of the | 117 "Old straight flag style (for composers like Bach). The angles of the |
118 flags are both 45 degrees." | 118 flags are both 45 degrees." |
119 ((straight-flag 0.55 1 -45 1.2 45 1.4) grob)) | 119 ((straight-flag 0.55 1 -45 1.2 45 1.4) grob)) |
120 | 120 |
121 | 121 |
122 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; | 122 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; |
123 ;;;; Flags created from feta glyphs (normal and mensural flags) | 123 ;;;; Flags created from feta glyphs (normal and mensural flags) |
124 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; | 124 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; |
125 | 125 |
126 | 126 |
127 ; NOTE: By default, lilypond uses the C++ method Stem::calc-flag | 127 ; NOTE: By default, lilypond uses the C++ method Flag::stencil |
128 ; (ly:stem::calc-flag is the corresponding Scheme interface) to generate the | 128 ; (ly:flag::stencil is the corresponding Scheme interface) to generate the |
129 ; flag stencil. The following functions are simply a reimplementation in | 129 ; flag stencil. The following functions are simply a reimplementation in |
130 ; Scheme, so that one has that functionality available in Scheme, if one | 130 ; Scheme, so that one has that functionality available in Scheme, if one |
131 ; wants to write a flag style, which modifies one of the standard flags | 131 ; wants to write a flag style, which modifies one of the standard flags |
132 ; by some stencil operations. | 132 ; by some stencil operations. |
133 | 133 |
134 | 134 |
135 (define-public (add-stroke-glyph stencil grob dir stroke-style flag-style) | 135 (define-public (add-stroke-glyph stencil grob dir stroke-style flag-style) |
136 "Load and add a stroke (represented by a glyph in the font) to the given | 136 "Load and add a stroke (represented by a glyph in the font) to the given |
137 flag stencil." | 137 flag stencil." |
138 (if (not (string? stroke-style)) | 138 (if (not (string? stroke-style)) |
(...skipping 66 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
205 | 205 |
206 | 206 |
207 (define-public (normal-flag grob) | 207 (define-public (normal-flag grob) |
208 "Create a default flag." | 208 "Create a default flag." |
209 (create-glyph-flag "" "" grob)) | 209 (create-glyph-flag "" "" grob)) |
210 | 210 |
211 | 211 |
212 | 212 |
213 (define-public (default-flag grob) | 213 (define-public (default-flag grob) |
214 "Create a flag stencil for the stem. Its style will be derived from the | 214 "Create a flag stencil for the stem. Its style will be derived from the |
215 @code{'flag-style} Stem property. By default, @code{lilypond} uses a | 215 @code{'style} Flag property. By default, @code{lilypond} uses a |
216 C++ Function (which is slightly faster) to do exactly the same as this | 216 C++ Function (which is slightly faster) to do exactly the same as this |
217 function. However, if one wants to modify the default flags, this function | 217 function. However, if one wants to modify the default flags, this function |
218 can be used to obtain the default flag stencil, which can then be modified | 218 can be used to obtain the default flag stencil, which can then be modified |
219 at will. The correct way to do this is: | 219 at will. The correct way to do this is: |
220 | 220 |
221 @example | 221 @example |
222 \\override Stem #'flag = #default-flag | 222 \\override Flag #'stencil = #default-flag |
223 \\override Stem #'flag-style = #'mensural | 223 \\override Flag #'style = #'mensural |
224 @end example | 224 @end example |
225 " | 225 " |
226 (let* ((stem-grob (ly:grob-parent grob X)) | 226 (let* ((stem-grob (ly:grob-parent grob X)) |
227 (flag-style-symbol (ly:grob-property grob 'flag-style)) | 227 (flag-style-symbol (ly:grob-property grob 'style)) |
228 (flag-style (if (symbol? flag-style-symbol) | 228 (flag-style (if (symbol? flag-style-symbol) |
229 (symbol->string flag-style-symbol) | 229 (symbol->string flag-style-symbol) |
230 ""))) | 230 ""))) |
231 (cond | 231 (cond |
232 ((equal? flag-style "") (normal-flag grob)) | 232 ((equal? flag-style "") (normal-flag grob)) |
233 ((equal? flag-style "mensural") (mensural-flag grob)) | 233 ((equal? flag-style "mensural") (mensural-flag grob)) |
234 ((equal? flag-style "no-flag") (no-flag grob)) | 234 ((equal? flag-style "no-flag") (no-flag grob)) |
235 (else ((glyph-flag flag-style) grob))))) | 235 (else ((glyph-flag flag-style) grob))))) |
LEFT | RIGHT |