diff options
author | Thomas Morley <thomasmorley65@gmail.com> | 2015-12-27 22:33:12 +0100 |
---|---|---|
committer | Thomas Morley <thomasmorley65@gmail.com> | 2016-01-03 16:03:02 +0100 |
commit | 7515e9c36a25c513f94c19a7b3d15ff17ba68a84 (patch) | |
tree | 739ae7a7c882272146e39a14161c981e1e225cfe | |
parent | 18e3e868a609a42eb009cf39a678b305a31987b2 (diff) |
Issue 4716 Improve note-by-number to deal better with flag-styles
- Per default every ancient note-head will get a mensural-style-flag.
- overriding flag-style will now always work with supported styles:
default, straight- and flat-flags and (neo-)mensural-flags
-rw-r--r-- | input/regression/markup-note-styles.ly | 18 | ||||
-rw-r--r-- | scm/define-markup-commands.scm | 33 |
2 files changed, 38 insertions, 13 deletions
diff --git a/input/regression/markup-note-styles.ly b/input/regression/markup-note-styles.ly index f5fbc9b60d..316a87c2a6 100644 --- a/input/regression/markup-note-styles.ly +++ b/input/regression/markup-note-styles.ly @@ -1,14 +1,15 @@ -\version "2.17.19" +\version "2.19.35" \header { texidoc = "@code{\\note-by-number} and @code{\\note} support -all note head styles and straight flags." +all note head styles and all flag styles (default, straight, flat, mensural)." } #(define styles-list '(default altdefault baroque neomensural mensural petrucci + semipetrucci blackpetrucci harmonic harmonic-black harmonic-mixed diamond cross xcircle @@ -35,6 +36,8 @@ all note head styles and straight flags." '(-3 -2 -1 0 1 2 3 4 5 6)))))))) styles)))) +%% Testing all combinations of note-head/flag-styles would be too much +%% Thus, limited examples \markup { \column { \combine \null \vspace #1 @@ -49,7 +52,7 @@ all note head styles and straight flags." \combine \null \vspace #1 \underline "Modern-straight-flag:" \override #'(flag-style . modern-straight-flag) - \show-note-styles #'(default) + \show-note-styles #'(default mensural) } } @@ -70,3 +73,12 @@ all note head styles and straight flags." \show-note-styles #'(default) } } + +\markup { + \column { + \combine \null \vspace #1 + \underline "default-flag:" + \override #'(flag-style . default) + \show-note-styles #'(default mensural) + } +} diff --git a/scm/define-markup-commands.scm b/scm/define-markup-commands.scm index 362080ed9b..e22e467f1e 100644 --- a/scm/define-markup-commands.scm +++ b/scm/define-markup-commands.scm @@ -3543,9 +3543,12 @@ A feta brace in point size @var{size}, rotated 180 degrees. Construct a note symbol, with stem and flag. By using fractional values for @var{dir}, longer or shorter stems can be obtained. -Supports all note-head-styles. +Supports all note-head-styles. Ancient note-head-styles will get +mensural-style-flags. @code{flag-style} may be overridden independently. Supported flag-styles are @code{default}, @code{old-straight-flag}, -@code{modern-straight-flag} and @code{flat-flag}. +@code{modern-straight-flag}, @code{flat-flag}, @code{mensural} and +@code{neomensural}. The latter two flag-styles will both result in +mensural-flags. Both are supplied for convenience. @lilypond[verbatim,quote] \\markup { @@ -3556,7 +3559,8 @@ Supported flag-styles are @code{default}, @code{old-straight-flag}, @end lilypond" (define (get-glyph-name-candidates dir log style) (map (lambda (dir-name) - (format #f "noteheads.~a~a" dir-name + (format #f "noteheads.~a~a" + dir-name (if (and (symbol? style) (not (equal? 'default style))) (select-head-glyph style (min log 2)) @@ -3642,7 +3646,9 @@ Supported flag-styles are @code{default}, @code{old-straight-flag}, (sign dir) log 'default)) result))) (head-glyph (ly:font-get-glyph font head-glyph-name)) - (ancient-flags? (or (eq? style 'mensural) (eq? style 'neomensural))) + (ancient-flags? + (member style + '(mensural neomensural petrucci semipetrucci blackpetrucci))) (attach-indices (ly:note-head::stem-attachment font head-glyph-name)) (stem-length (* size-factor (max 3 (- log 1)))) ;; With ancient-flags we want a tighter stem @@ -3658,7 +3664,10 @@ Supported flag-styles are @code{default}, @code{old-straight-flag}, (cdr attach-indices))))) ;; For a tighter stem (with ancient-flags) the stem-width has to be ;; adjusted. - (stem-X-corr (if ancient-flags? (* 0.5 dir stem-thickness) 0)) + (stem-X-corr + (if (or ancient-flags? + (member flag-style '(mensural neomensural))) + (* 0.5 dir stem-thickness) 0)) (stem-glyph (and (> log 0) (ly:round-filled-box (ordered-cons (+ stem-X-corr (car attach-off)) @@ -3696,11 +3705,15 @@ Supported flag-styles are @code{default}, @code{old-straight-flag}, flat-flag) (else (ly:font-get-glyph font - (format #f (if ancient-flags? - "flags.mensural~a2~a" - "flags.~a~a") - (if (> dir 0) "u" "d") - log)))) + (format #f + (if (or (member flag-style + '(mensural neomensural)) + (and ancient-flags? + (null? flag-style))) + "flags.mensural~a2~a" + "flags.~a~a") + (if (> dir 0) "u" "d") + log)))) (cons (+ (car attach-off) ;; For tighter stems (with ancient-flags) the ;; flag has to be adjusted different. |