text.
* lily/text-item.cc (markup_text2molecule): Bugfix: raise only once.
2002-06-26 Jan Nieuwenhuizen <janneke@gnu.org>
+ * scm/chord-name.scm (chord::name->text): Workaround: clean markup
+ text.
+
+ * lily/text-item.cc (markup_text2molecule): Bugfix: raise only once.
+
* input/test/ambitus.ly:
* lily/ambitus-engraver.cc:
* lily/ambitus.cc:
--- /dev/null
+\header{
+ texidoc = "chord/markup test"
+}
+
+\paper{ linewidth = -1.0\mm }
+
+\score{
+ <
+ \context Staff \notes \relative c'' {
+ c^#'(columns "foe" ((raise . 3) "bar"))
+ c
+ c^#'(columns "foe" (super "12") (sub "3 4"))
+ c
+
+ %% broken for now
+ %% c^#`(columns (lines "" ";" "") (lines "1" (bold "2") "3"))
+ c^#`(columns (lines "" ";" "") (lines "1" (columns (bold "2")) "3"))
+ }
+ \context ChordNames \chords {
+ c:7+.9-^3.5
+ }
+ >
+}
f-#'(finger "3")
g-#'(music (named "noteheads-2"
((kern . -0.1) "flags-stem")
- (((kern . -0.1) (raise . 3.5)) "flags-u3"))))
+ (((kern . -0.1) (raise . 3.5)) "flags-u3")))
b-#'(columns "a" (((kern . 3) (raise . 2)) "b") "c")
c-#'(columns "1" (((raise . -2) (kern . -1)) "2") "3")
% }
c^#'(columns "foe" ((raise . 3) "bar"))
c^#'(columns "foe" (super "12") (sub "3 4"))
+ %% UGHUGH
+ c^#'(columns "foe" (super ((raise . 1) "12")) (sub ((raise . -1) "3 4")))
c^#'(columns "foe" (super (overstrike "o") "/") (sub "x"))
c^#'(columns "foe" (overstrike "o") "/")
c^#'(columns "foe" ((bold roman overstrike) "o") "/")
SCM r = ly_assoc_chain (ly_symbol2scm ("raise"), p);
if (gh_pair_p (r) && gh_number_p (ly_cdr (r)))
raise = gh_scm2double (ly_cdr (r)) * staff_space;
+
Interval extent;
bool extent_b = false;
}
Offset o (kern[X_AXIS], raise - kern[Y_AXIS]);
-
Molecule mol = Lookup::filledbox (Box (Interval (0,0), Interval (0,0)));
+
+ SCM cp = ly_deep_copy (p);
+ if (raise)
+ {
+ SCM cr = ly_assoc_chain (ly_symbol2scm ("raise"), cp);
+ scm_set_cdr_x (cr, gh_int2scm (0));
+ }
while (gh_pair_p (text))
{
- Molecule m = text2molecule (me, ly_car (text), p);
+ Molecule m = text2molecule (me, ly_car (text), cp);
if (!m.empty_b ())
{
text = ly_cdr (text);
}
+
/* Set extend to markup requested value. */
if (extent_b)
{
(define (chord::text? text)
(not (or (not text) (empty? text) (unspecified? text))))
+;; FIXME: remove need for me, use text-append throughout
(define (chord::text-cleanup dirty)
"
Recursively remove '() #f, and #<unspecified> from markup text tree.
(list (list '((raise . 1) (font-relative-size . -1))) adds-text subs-text)
b+i-text)))
-(define (chord::name-banter tonic exception-part unmatched-steps
- bass-and-inversion steps)
- (let ((additions (chord::additions unmatched-steps))
- (subtractions (chord::subtractions unmatched-steps)))
- (chord::inner-name-banter tonic exception-part additions subtractions
- bass-and-inversion steps)))
-
-
(define (c++-pitch->scm p)
(if (pitch? p)
(list (pitch-octave p) (pitch-notename p) (pitch-alteration p))
(define (chord::name-banter tonic exception-part unmatched-steps
bass-and-inversion steps)
- (let ((additions (chord::additions unmatched-steps))
- (subtractions (chord::subtractions unmatched-steps)))
- (chord::inner-name-banter tonic exception-part additions subtractions
- bass-and-inversion steps)))
+ (let ((additions (chord::additions unmatched-steps))
+ (subtractions (chord::subtractions unmatched-steps)))
+ (chord::inner-name-banter tonic exception-part additions subtractions
+ bass-and-inversion steps)))
+
(define (chord::restyle name style)
(primitive-eval (string->symbol
(let* ((lookup (chord::exceptions-lookup style steps))
(exception-part (car lookup))
(unmatched-steps (cadr lookup)))
- ((chord::restyle 'chord::name- style)
- tonic exception-part unmatched-steps bass-and-inversion steps)))
+ (chord::text-cleanup
+ ((chord::restyle 'chord::name- style)
+ tonic exception-part unmatched-steps bass-and-inversion steps))))
;; C++ entry point
;;