From 3e3583792b9e41b5ef79af43e7f60267d4d37962 Mon Sep 17 00:00:00 2001 From: fred Date: Wed, 27 Mar 2002 00:33:59 +0000 Subject: [PATCH] lilypond-1.3.113 --- input/test/markup.ly | 6 +++++- lily/text-item.cc | 28 ++++++++++++++++++---------- scm/chord-name.scm | 4 ++-- scm/font.scm | 2 +- 4 files changed, 26 insertions(+), 14 deletions(-) diff --git a/input/test/markup.ly b/input/test/markup.ly index d6d882f88d..4b35fea469 100644 --- a/input/test/markup.ly +++ b/input/test/markup.ly @@ -18,7 +18,11 @@ (italic "three")) f-\textscript #'(finger "3") g-\textscript #'(music (named "noteheads-2" "flags-u3")) - } + + b-#'(rows "a" ((kern . 3) ((raise . 2) "b")) "c") + c-#'(rows "1" ((kern . -3) ((raise . -2) "2")) "3") + + } \paper{ linewidth = -1.\mm; \translator{ diff --git a/lily/text-item.cc b/lily/text-item.cc index 34c710db9d..ef256e5b7a 100644 --- a/lily/text-item.cc +++ b/lily/text-item.cc @@ -28,7 +28,7 @@ */ /* - TODO: + FIXME: rewrite routines and syntax to be like @@ -128,13 +128,6 @@ Molecule Text_item::markup_sentence2molecule (Grob *me, SCM markup_sentence, SCM alist_chain) { - /* - FIXME - - huh? - */ - // return Molecule (); - SCM sheet = me->paper_l ()->style_sheet_; SCM f = gh_cdr (scm_assoc (ly_symbol2scm ("markup-to-properties"), sheet)); @@ -159,17 +152,32 @@ Text_item::markup_sentence2molecule (Grob *me, SCM markup_sentence, if (gh_pair_p (r) && gh_number_p (gh_cdr (r))) raise = gh_scm2double (gh_cdr (r)) * staff_space; +#if 0 Offset o (align == X_AXIS ? kern : 0, (align == Y_AXIS ? - kern : 0) + raise); - +#else + Offset o (0, (align == Y_AXIS ? - kern : 0) + raise); +#endif + Molecule mol; while (gh_pair_p (sentence)) { + /* Ugh: this (kerning) only works if 'kern' is the first modifier of a + markup. I guess the only solution is to rewrite markup definition, + see above. */ Molecule m = text2molecule (me, gh_car (sentence), p); + Real m_kern = 0; + SCM m_p = SCM_EOL; + if (gh_pair_p (gh_car (sentence))) + m_p = gh_cons (gh_call2 (f, sheet, gh_caar (sentence)), alist_chain); + SCM m_k = ly_assoc_chain (ly_symbol2scm ("kern"), m_p); + if (gh_pair_p (m_k) && gh_number_p (gh_cdr (m_k))) + m_kern = gh_scm2double (gh_cdr (m_k)) * staff_space; + if (!m.empty_b ()) { m.translate (o); - mol.add_at_edge (align, align == X_AXIS ? RIGHT : DOWN, m, 0); + mol.add_at_edge (align, align == X_AXIS ? RIGHT : DOWN, m, m_kern); } sentence = gh_cdr (sentence); } diff --git a/scm/chord-name.scm b/scm/chord-name.scm index d3ad48943c..49604d17bb 100644 --- a/scm/chord-name.scm +++ b/scm/chord-name.scm @@ -96,8 +96,8 @@ (((0 . 0) (2 . -1) (4 . 0) (6 . 0)) . ("m(maj7)")) ;jazz: the delta, see jazz-chords.ly ;;(((0 . 0) (2 . -1) (4 . -1) (6 . -2)) . (super ((font-family . math) "N")) - ;; slashed o - (((0 . 0) (2 . -1) (4 . -1) (6 . -1)) . (rows ((raise . 1) "o") ((raise . 0.5) ((kern . -0.5) ((font-relative-size . -3) "/"))) "7")) ; slashed o + ;; ugh, kludge slashed o + (((0 . 0) (2 . -1) (4 . -1) (6 . -1)) . (rows ((raise . 1) "o") ((kern . -0.85) ((raise . 0.57) ((font-relative-size . -3) "/"))) "7")) ; slashed o (((0 . 0) (2 . 0) (4 . 1) (6 . -1)) . ("aug7")) (((0 . 0) (2 . 0) (4 . -1) (6 . 0)) . (rows "maj7" ((font-relative-size . -2) ((raise . 0.2) (music (named "accidentals--1")))) "5")) (((0 . 0) (2 . 0) (4 . -1) (6 . -1)) . (rows "7" ((font-relative-size . -2) ((raise . 0.2) (music (named "accidentals--1")))) "5")) diff --git a/scm/font.scm b/scm/font.scm index fec9446ef5..2682e60011 100644 --- a/scm/font.scm +++ b/scm/font.scm @@ -201,7 +201,7 @@ . ((rows . ((align . 0))) (lines . ((align . 1))) (roman . ((font-family . roman))) - (music . ((font-family . music) (font-shape . upright))) + (music . ((font-family . music) (font-shape . upright) (lookup . name))) (finger . ((font-style . finger))) (bold . ((font-series . bold))) (italic . ((font-shape . italic))) -- 2.39.5