davidnalesnik / lilypond-roman-numeral-tool

LilyPond typesetter for Roman numeral harmonic analysis
MIT License
23 stars 7 forks source link

Unpretty vertical alignment of figureless accidentals #5

Open ghost opened 8 years ago

ghost commented 8 years ago

Only naturals and (to a lesser extent) sharps are affected, flats are positioned nicely:

\markup \rN { V 6 5 f }
\markup \rN { V 6 5 n }
\markup \rN { V 6 5 s }

unpretty

davidnalesnik commented 8 years ago

Right now figures are put in a right-aligned column. Center-column looks right with this example, but it will cause ugliness when a longer figure (like a figure with an alteration before it) is combined with shorter.

davidnalesnik commented 8 years ago

To see what's going on and a possible solution, look at the output of the following code:

\version "2.19.30"

\header {
  tagline = ##f
}

\markup \override #'(baseline-skip . 2.5) \right-column { \box { foobar 5 \natural } }

\markup \override #'(baseline-skip . 2.5) \right-column { \box { foobar 5 \hcenter-in #1.25 \natural } }

\markup \override #'(baseline-skip . 2.5) \right-column {
  \box { foobar 5 \concat { 3 \hcenter-in #1.25 \natural } }
}

column-test

The first example shows that the poor positioning of the natural is due to its smaller stencil extent in the X direction. (It also shows the rationale behind a right-aligned column.)

The second example modifies the positioning of the natural by enlarging the stencil-width to match a typical figure number. (This appears to be the only way to adjust positioning within a right-column.)

The third example demonstrates that that enlarged character might be combined with others. Perhaps the enlargement would substitute for the whitespace currently being added between accidental and number.)

Possibly we should define a special set of accidentals for use within figures, each one enlarged so its extents match some representative number.