From 758612d5b76f59c2251b131357f798f2567a1e55 Mon Sep 17 00:00:00 2001 From: David Kastrup Date: Tue, 5 Nov 2013 21:15:23 +0100 Subject: [PATCH] Revert "format-metronome-mark and metronome-markup don't support styles other than default" This reverts commit 12e6948fe2fa0c73103748fd815a7c93fdc3677e. --- input/regression/metronome-mark-formatter.ly | 108 ------------------- lily/text-interface.cc | 1 - scm/define-grob-properties.scm | 4 - scm/define-grobs.scm | 1 - scm/translation-functions.scm | 56 ++++------ 5 files changed, 18 insertions(+), 152 deletions(-) delete mode 100644 input/regression/metronome-mark-formatter.ly diff --git a/input/regression/metronome-mark-formatter.ly b/input/regression/metronome-mark-formatter.ly deleted file mode 100644 index 480429f30e..0000000000 --- a/input/regression/metronome-mark-formatter.ly +++ /dev/null @@ -1,108 +0,0 @@ -\version "2.17.27" - -\header { - texidoc = "@code{metronomeMarkFormatter} supports -all note head styles and flags styles. Setting @code{font-name} for -@code{MetronomeMark} does not disturb the glyphs for note-head and flag. -" -} - -\paper { - ragged-right = ##f - indent = 30 -} - -mus = -\relative c'' { - \tempo "Allegro" 8=120-140 - a8 b c d a b c d - \override Score.MetronomeMark.font-name = "Times New Roman" - \tempo "Allegro" 8=140 - a b c d a b c d -} - -%% Some Examples: -\score { - \new Staff - \with { - instrumentName = "default" - } - \mus - \layout {} -} - -\score { - \new Staff - \with { - instrumentName = - \markup \column { "default-note-head" "old-straight-flag" } - } - \mus - \layout { - \context { - \Score - \override MetronomeMark.flag-style = #'old-straight-flag - } - } -} - -\score { - \new Staff - \with { - instrumentName = - \markup \column { "default-note-head" "modern-straight-flag" } - } - \mus - \layout { - \context { - \Score - \override MetronomeMark.flag-style = #'modern-straight-flag - } - } -} - -\score { - \new Staff - \with { - instrumentName = - \markup \column { "default-note-head" "flat-flag" } - } - \mus - \layout { - \context { - \Score - \override MetronomeMark.flag-style = #'flat-flag - } - } -} - -\score { - \new Staff - \with { - instrumentName = - \markup \column { "diamond-note-head" "modern-straight-flag" } - } - \mus - \layout { - \context { - \Score - \override MetronomeMark.style = #'diamond - \override MetronomeMark.flag-style = #'modern-straight-flag - } - } -} - -\score { - \new MensuralStaff - \with { - instrumentName = - \markup \column { "mensural-note-head" "mensural-flag" } - } - \mus - \layout { - \context { - \Score - \override MetronomeMark.style = #'mensural - } - } -} diff --git a/lily/text-interface.cc b/lily/text-interface.cc index 936a7488e2..c406beaab5 100644 --- a/lily/text-interface.cc +++ b/lily/text-interface.cc @@ -207,6 +207,5 @@ ADD_INTERFACE (Text_interface, "text " "word-space " "text-direction " - "flag-style " ); diff --git a/scm/define-grob-properties.scm b/scm/define-grob-properties.scm index a5b0895c9b..00cbaeb55c 100644 --- a/scm/define-grob-properties.scm +++ b/scm/define-grob-properties.scm @@ -283,10 +283,6 @@ set this to @code{(+inf.0 . -inf.0)}.") ;;; f ;;; (flag-count ,number? "The number of tremolo beams.") - (flag-style ,symbol? "The style of the flag to be used with -@code{MetronomeMark}. Available are @code{'modern-straight-flag}, -@code{'old-straight-flag}, @code{flat-flag}, @code{mensural} and -@code{'default}") (flat-positions ,list? "Flats in key signatures are placed within the specified ranges of staff-positions. The general form is a list of pairs, with one pair for each type of clef, in order diff --git a/scm/define-grobs.scm b/scm/define-grobs.scm index a4e0d52a76..b415cee9d6 100644 --- a/scm/define-grobs.scm +++ b/scm/define-grobs.scm @@ -1458,7 +1458,6 @@ (break-visibility . ,end-of-line-invisible) (direction . ,UP) (extra-spacing-width . (+inf.0 . -inf.0)) - (flag-style . default) (outside-staff-horizontal-padding . 0.2) (outside-staff-priority . 1000) (padding . 0.8) diff --git a/scm/translation-functions.scm b/scm/translation-functions.scm index fa3426ff0a..9bc12cc53c 100644 --- a/scm/translation-functions.scm +++ b/scm/translation-functions.scm @@ -38,53 +38,33 @@ way the transposition number is displayed." ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;; metronome marks -;; We give 'styled-metronome-markup' an optional argument, 'glyph-font', to -;; prepare using other fonts than 'fetaMusic. -;; Currently it ensures that the default-fonts are used by the -;; markup-command 'note-by-number' in 'metronome-markup' (see below). -(define*-public - ((styled-metronome-markup #:optional (glyph-font 'default)) - event context) - (let ((hide-note (ly:context-property context 'tempoHideNote #f)) - (text (ly:event-property event 'text)) - (dur (ly:event-property event 'tempo-unit)) - (count (ly:event-property event 'metronome-count))) - - (metronome-markup glyph-font text dur count hide-note))) - -(define-public format-metronome-markup - (styled-metronome-markup)) - -(define (metronome-markup glyph-font text dur count hide-note) - (let* ((note-mark - (if (and (not hide-note) (ly:duration? dur)) - (make-smaller-markup - ;; We insert the (default)-font for flag-glyphs and - ;; note-head-glyphs to prepare the possibility to use - ;; other fonts and to make possible using - ;; \override MetronomeMark #'font-name = # - ;; without affecting the note/flag-glyphs. - (make-override-markup (cons 'font-name glyph-font) - (make-note-by-number-markup - (ly:duration-log dur) - (ly:duration-dot-count dur) - UP))) - #f)) +(define-public (format-metronome-markup event context) + (let ((hide-note (ly:context-property context 'tempoHideNote #f)) + (text (ly:event-property event 'text)) + (dur (ly:event-property event 'tempo-unit)) + (count (ly:event-property event 'metronome-count))) + + (metronome-markup text dur count hide-note))) + +(define-public (metronome-markup text dur count hide-note) + (let* ((note-mark (if (and (not hide-note) (ly:duration? dur)) + (make-smaller-markup + (make-note-by-number-markup (ly:duration-log dur) + (ly:duration-dot-count dur) + 1)) + #f)) (count-markup (cond ((number? count) (if (> count 0) - (make-simple-markup - (number->string count)) + (make-simple-markup (number->string count)) #f)) ((pair? count) (make-concat-markup (list - (make-simple-markup - (number->string (car count))) + (make-simple-markup (number->string (car count))) (make-simple-markup " ") (make-simple-markup "–") (make-simple-markup " ") - (make-simple-markup - (number->string (cdr count)))))) + (make-simple-markup (number->string (cdr count)))))) (else #f))) (note-markup (if (and (not hide-note) count-markup) (make-concat-markup -- 2.39.5