From: Thomas Morley Date: Sun, 27 Dec 2015 21:33:12 +0000 (+0100) Subject: Issue 4716 Improve note-by-number to deal better with flag-styles X-Git-Tag: release/2.19.36-1~34 X-Git-Url: https://git.donarmstrong.com/?a=commitdiff_plain;h=7515e9c36a25c513f94c19a7b3d15ff17ba68a84;hp=18e3e868a609a42eb009cf39a678b305a31987b2;p=lilypond.git 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 --- 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.