From bf7f767457c037009f996f5b26c8f1ba49488751 Mon Sep 17 00:00:00 2001 From: Thomas Morley Date: Sat, 12 Sep 2015 23:32:51 +0200 Subject: [PATCH] Let note-by-number and rest-by-number be robust against overriding font-name issue 4606 This is done by setting font-name #f as it is done for musicglyph already. Reverts some additions made by issue 3096, which became redundant now. --- scm/define-markup-commands.scm | 7 +++++-- scm/translation-functions.scm | 34 +++++++++------------------------- 2 files changed, 14 insertions(+), 27 deletions(-) diff --git a/scm/define-markup-commands.scm b/scm/define-markup-commands.scm index 8d15ac9e29..57e2e8893a 100644 --- a/scm/define-markup-commands.scm +++ b/scm/define-markup-commands.scm @@ -3534,7 +3534,8 @@ Supported flag-styles are @code{default}, @code{old-straight-flag}, (flag-stencil (buildflags stencil (- log 3) stencil spacing))) flag-stencil)) - (let* ((font (ly:paper-get-font layout (cons '((font-encoding . fetaMusic)) + (let* ((font (ly:paper-get-font layout (cons '((font-encoding . fetaMusic) + (font-name . #f)) props))) (size-factor (magstep font-size)) (blot (ly:output-def-lookup layout 'blot-diameter)) @@ -3750,7 +3751,9 @@ A rest or multi-measure-rest symbol. (let* ((font (ly:paper-get-font layout - (cons '((font-encoding . fetaMusic)) props))) + (cons '((font-encoding . fetaMusic) + (font-name . #f)) + props))) (rest-glyph-name (let ((result (get-glyph-name font diff --git a/scm/translation-functions.scm b/scm/translation-functions.scm index 219275fafa..2a3701ea16 100644 --- a/scm/translation-functions.scm +++ b/scm/translation-functions.scm @@ -38,39 +38,23 @@ 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* - ((styled-metronome-markup #:optional (glyph-font 'default)) - event context) +(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))) +(export format-metronome-markup) - (metronome-markup glyph-font text dur count hide-note))) -(export styled-metronome-markup) - -(define-public format-metronome-markup - (styled-metronome-markup)) - -(define (metronome-markup glyph-font text dur count hide-note) +(define (metronome-markup 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)) + (make-note-by-number-markup + (ly:duration-log dur) + (ly:duration-dot-count dur) + UP)) + #f)) (count-markup (cond ((number? count) (if (> count 0) (make-simple-markup -- 2.39.2