#include "lookup.hh"
#include "output-def.hh"
#include "staff-symbol-referencer.hh"
+#include "rational.hh"
struct Key_signature_interface
{
DECLARE_SCHEME_CALLBACK (print, (SCM));
-
DECLARE_GROB_INTERFACE();
};
for (SCM s = me->get_property ("alteration-alist"); scm_is_pair (s); s = scm_cdr (s))
{
SCM alt = is_cancellation
- ? scm_from_int (0)
+ ? scm_from_int (0)
: scm_cdar (s);
SCM glyph_name = ly_assoc_get (alt, alist, SCM_BOOL_F);
+ if (!scm_is_string (glyph_name))
+ {
+ me->warning (_f ("No glyph found for alteration: %s",
+ ly_scm2rational (alt).to_string ().c_str ()));
+ continue;
+ }
+
Stencil acc (fm->find_by_name (ly_scm2string (glyph_name)));
if (acc.is_empty ())
(KeyCancellation
. (
(stencil . ,ly:key-signature-interface::print)
+ (glyph-name-alist . ,cancellation-glyph-name-alist)
(space-alist . (
(time-signature . (extra-space . 1.25))
(staff-bar . (extra-space . 0.6))
(define-public (accidental-interface::calc-alteration grob)
(ly:pitch-alteration (ly:event-property (event-cause grob) 'pitch)))
+
+(define-public cancellation-glyph-name-alist
+ '((0 . "accidentals.natural")))
+
(define-public standard-alteration-glyph-name-alist
- '((1 . "accidentals.doublesharp")
- (3/4 . "accidentals.sharp.slashslash.stemstemstem")
+ '(
+ ;; ordered for optimal performance.
+ (0 . "accidentals.natural")
+ (-1/2 . "accidentals.flat")
(1/2 . "accidentals.sharp")
+
+ (1 . "accidentals.doublesharp")
+ (-1 . "accidentals.flatflat")
+
+ (3/4 . "accidentals.sharp.slashslash.stemstemstem")
(1/4 . "accidentals.sharp.slashslash.stem")
- (0 . "accidentals.natural")
(-1/4 . "accidentals.mirroredflat")
- (-1/2 . "accidentals.flat")
(-3/4 . "accidentals.mirroredflat.flat")
- (-1 . "accidentals.flatflat")
))
(define-public makam-alteration-glyph-name-alist