From: Jan Nieuwenhuizen Date: Tue, 17 Oct 2000 22:42:23 +0000 (+0200) Subject: patch::: 1.3.96.jcn3 X-Git-Tag: release/1.3.97~8 X-Git-Url: https://git.donarmstrong.com/?a=commitdiff_plain;h=d5e71a32827fcb2618a33295c6d6df97b933f2de;p=lilypond.git patch::: 1.3.96.jcn3 1.3.96.jcn3 =========== * Fixed (added actually, it got lost?) word-space for chords. --- diff --git a/CHANGES b/CHANGES index 3a94fe3357..e96d44c89e 100644 --- a/CHANGES +++ b/CHANGES @@ -1,3 +1,8 @@ +1.3.96.jcn3 +=========== + +* Fixed (added actually, it got lost?) word-space for chords. + 1.3.96.jcn1 =========== diff --git a/VERSION b/VERSION index 6626833139..a09a984736 100644 --- a/VERSION +++ b/VERSION @@ -2,7 +2,7 @@ PACKAGE_NAME=LilyPond MAJOR_VERSION=1 MINOR_VERSION=3 PATCH_LEVEL=96 -MY_PATCH_LEVEL=jcn2 +MY_PATCH_LEVEL=jcn3 # use the above to send patches: MY_PATCH_LEVEL is always empty for a # released version. diff --git a/input/test/american-chords.ly b/input/test/american-chords.ly index bb344b2256..91f6238088 100644 --- a/input/test/american-chords.ly +++ b/input/test/american-chords.ly @@ -13,7 +13,7 @@ chord::names-alist-american)) chord = \notes\transpose c''\chords{ -\property ChordNames.chordNameStyle = "american" + \property ChordNames.ChordName \push #'style = #"american" c cs:m df:m5- @@ -46,8 +46,10 @@ c:m7.9 > \paper { - \translator { \ChordNameContext chordNameWordSpace = #1 } - \translator { \LyricsContext textScriptWordSpace = #0.3 } + \translator { + \ChordNameContext + ChordName \push #'word-space = #1 + } } } diff --git a/input/test/chord-names.ly b/input/test/chord-names.ly index 500f98e949..76a0246148 100644 --- a/input/test/chord-names.ly +++ b/input/test/chord-names.ly @@ -20,8 +20,10 @@ chord = \notes\transpose c''\chords{ > \paper{ linewidth = -1.0; - \translator { \ChordNameContext chordNameWordSpace = #1 } - \translator { \LyricsContext textScriptWordSpace = #0.3 } + \translator { + \ChordNameContext + ChordName \push #'word-space = #1 + } } } diff --git a/input/test/chords.ly b/input/test/chords.ly index 8fc784cb40..8a6b07823f 100644 --- a/input/test/chords.ly +++ b/input/test/chords.ly @@ -59,4 +59,10 @@ keys = \notes{ \context ChordNames \scales \context Staff < \scales \keys > > + \paper{ + \translator { + \ChordNameContext + ChordName \push #'word-space = #1 + } + } } diff --git a/input/test/jazz-chords.ly b/input/test/jazz-chords.ly index 2e18444a95..731a360f1e 100644 --- a/input/test/jazz-chords.ly +++ b/input/test/jazz-chords.ly @@ -1,11 +1,11 @@ -% -% Make sure the correct msamxx.tfm is where lily can find it -% (ie cwd or lily's tfm dir). -% -% For normal (20pt) paper, do -% -% cp locate `msam9.tfm` $LILYPONDPREFIX/tfm -% +%% This should only be necessary if your kpathsea setup is broken +%% +%% Make sure the correct msamxx.tfm is where lily can find it +%% (ie cwd or lily's tfm dir). +%% +%% For normal (20pt) paper, do +%% +%% cp locate `msam9.tfm` $LILYPONDPREFIX/tfm #(set! chord::names-alist-american (append @@ -25,20 +25,22 @@ chord::names-alist-american)) chord = \notes\transpose c''\chords{ -\property ChordNames.chordNameStyle = "american" -c:m5-.7- -c:m5-.7 + \property ChordNames.ChordName \push #'style = #"american" + c:m5-.7- + c:m5-.7 } \score{ -< -\context ChordNames \chord -\context Staff \chord -> + < + \context ChordNames \chord + \context Staff \chord + > \paper { - \translator { \ChordNameContext chordNameWordSpace = #1 } - \translator { \LyricsContext textScriptWordSpace = #0.3 } + \translator { + \ChordNameContext + ChordName \push #'word-space = #1 + } } } diff --git a/lily/chord-name.cc b/lily/chord-name.cc index 19650961e2..dff902e2bd 100644 --- a/lily/chord-name.cc +++ b/lily/chord-name.cc @@ -13,6 +13,7 @@ #include "score-element.hh" #include "paper-column.hh" #include "line-of-score.hh" +#include "staff-symbol-referencer.hh" /* TODO: move text lookup out of Chord_name @@ -169,5 +170,16 @@ Chord_name::brew_molecule (SCM smob) SCM func = me->get_elt_property (ly_symbol2scm ("chord-name-function")); SCM text = gh_call3 (func, style, pitches, gh_cons (inversion, bass)); - return ly_text2molecule (me, text).create_scheme (); + Molecule mol = ly_text2molecule (me, text); + + SCM space = me->get_elt_property ("word-space"); + if (gh_number_p (space)) + { + Molecule m; + m.set_empty (false); + mol.add_at_edge (X_AXIS, RIGHT, m, gh_scm2double (space)* + Staff_symbol_referencer::staff_space (me)); + } + + return mol.create_scheme (); }